On May 11, 11:15 am, HelloWorld <zuckerp...@gmail.com> wrote: > Hi Jirka > > Thanks for your answer! > > By structure I mean, I just followed the tutorial and am not sure if > the position and order of these tutorial code is right in my code: > > class Poll(models.Model): > # ... > def __unicode__(self): > return self.question > > class Choice(models.Model): > # ... > def __unicode__(self): > return self.choice > > AND > > import datetime > # ... > class Poll(models.Model): > # ... > def was_published_today(self): > return self.pub_date.date() == datetime.date.today() > > And I know the result is wrong because in the API it does not return > what the tutorial says should be returned: > > TUTORIAL: > > >>> from mysite.polls.models import Poll, Choice > > # Make sure our __unicode__() addition worked.>>> Poll.objects.all() > > [<Poll: What's up?>] > > ME: > > >>> Poll.objects.all() > > [<Poll: Poll object>] > > Thanks for the time! > > Best > > Z.
A simple suggestion: have you quit and reloaded the shell? -- DR. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.