i have this code from the django sample tutorial
from django.db import models
from datetime import datetime
# Create your models here.
class Poll(models.Model):
question = models.CharField(max_length=200)
pub_date = models.DateTimeField('date published')
def __unicode__(self):
return self.question
def was_published_today(self):
return self.pub_date.date() == datetime.date.today()
and i am getting this error: IndentationError: unexpected indent
on this line:
def __unicode__(self):
any idea what is wrong ??
My only guess is you have tabs mixed with spaces.
It’s recommended to use spaces over tabs, with 4 spaces per indentation.
http://www.python.org/dev/peps/pep-0008/
Do you have invisible characters visible on your editor to make sure that isn’t the case?
PS: your reputation graph says -6000 and it’s really bugging me out.