Opened 15 years ago

Closed 15 years ago

#6680 closed (invalid)

Error in 0.96 tutorial 1 documentation

Reported by: Colin Humber Owned by: nobody
Component: Documentation Version: 0.96
Severity: Keywords: Tutorial
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


The line within the Poll.was_published_today(self) function does not work:

return ==

The python shell complains that object has no attribute 'date'. When I change the line to:
return self.pub_date ==

it works fine.

Change History (1)

comment:1 Changed 15 years ago by Malcolm Tredinnick

Resolution: invalid
Status: newclosed

pub_date should be a DateTimeField. It looks like you may have made it a DateField instead. A DateTimeField will mean the Python attribute should be a datetime.datetime}} object, which does have a {{{date() method.

Check your models (and database) carefully and, if you're still having troubles, post your models to the django-users list with an explanation of what's going wrong. I just worked through the tutorial quickly up to that point and it worked fine for me, so I suspect there's a typo on your end.

Note: See TracTickets for help on using tickets.
Back to Top