On Sat, Oct 18, 2008 at 8:01 PM, Brendan Miller <[EMAIL PROTECTED]>wrote:
> > I was running through the tutorial to get up to speed on django. > > Most of the way down tutorial 2, it asks you to add a list display to > the PollAdmin: > list_display = ('question', 'pub_date', 'was_published_today') > > When viewing the relevant page, this explodes with: > > TemplateSyntaxError at /admin/polls/poll/ > Caught an exception while rendering: was_published_today() takes > exactly 1 argument (2 given) > > Where the tutorial tells you to define was_published_today with no > arguments (aside from self). > > I'm using a fresh install of django 1.0. Has the behavior changed > since the tutorial was written? > > No, the tutorial is correct. You would get the error you are reporting if you added the was_published_today method to the PollAdmin class instead of the Poll model class, since ModelAdmin methods in list_display are called with two arguments as described here: http://docs.djangoproject.com/en/dev/ref/contrib/admin/#list-display The tutorial, though, puts it on the Poll model. Where is yours? Karen --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com 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 -~----------~----~----~----~------~----~------~--~---