Jason Ourscene wrote:
> First i had my python issue, got that settled and now in the first
> django tutorial I create my poll model and add the def __unicode__
> method and im getting an error. heres the code, and the error:
>
> Code: http://pastie.textmate.org/197323
> and my error: http://pastie.textmate.org/197324
>
> Let me know what you guys think.
Luckily, the error is exactly what it sounds like, an indentation error.
You have:
class Poll(models.Model):
question = models.CharField(max_length=200)
pub_date = models.DateTimeField('date published')
def __unicode__(self):
return self.question
What you should have:
class Poll(models.Model):
question = models.CharField(max_length=200)
pub_date = models.DateTimeField('date published')
def __unicode__(self):
return self.question
Also, you should always use one of tabs or spaces, not mix them (you had
some mixed in what I pasted here). Spaces are preferred, take a look at
http://www.python.org/dev/peps/pep-0007/, it's the Python style guide.
gav
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---