Boston Python Workshop/Saturday/Web app project: Difference between revisions

Content added Content deleted
Line 290: Line 290:
def __unicode__(self):
def __unicode__(self):
return self.choice
return self.choice

Save the models.py file.


It's important to add __unicode__() methods to your models, not only for your own sanity when dealing with the interactive prompt, but also because objects' representations are used throughout Django's automatically-generated admin.
It's important to add __unicode__() methods to your models, not only for your own sanity when dealing with the interactive prompt, but also because objects' representations are used throughout Django's automatically-generated admin.