#14052: Error on a code in Tutorial 01
----------------------------+-----------------------------------------------
Reporter: wagnerluis1982 | Owner: nobody
Status: new | Milestone:
Component: Documentation | Version: 1.2
Keywords: | Stage: Unreviewed
Has_patch: 0 |
----------------------------+-----------------------------------------------
I'm learning Python and Django, and in tutorial 01, on url
[http://docs.djangoproject.com/en/dev/intro/tutorial01/#intro-tutorial01],
I think the code that's adding a custom method in the Poll class is wrong.
Where is written:
{{{
import datetime
# ...
class Poll(models.Model):
# ...
def was_published_today(self):
return self.pub_date.date() == datetime.date.today()
}}}
should be:
{{{
#!python
import datetime
# ...
class Poll(models.Model):
# ...
def was_published_today(self):
return self.pub_date.date() == datetime.today().date()
}}}
The error is in the order today date invocation.
Sorry for my poor english, I'm brazillian.
--
Ticket URL: <http://code.djangoproject.com/ticket/14052>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" 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-updates?hl=en.