#16668: Problem with was_published_today()
----------------------------+-------------------------------
Reporter: dan.j.hakimi@… | Owner: nobody
Type: Bug | Status: new
Milestone: | Component: Documentation
Version: 1.3 | Severity: Normal
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Easy pickings: 1
UI/UX: 0 |
----------------------------+-------------------------------
On https://docs.djangoproject.com/en/1.3/intro/tutorial01/, you write the
following function:
{{{
def was_published_today(self):
return self.pub_date.date() == datetime.date.today()
}}}
This doesn't work (I tried it), as "today" returns a full datetime,
instead of just a date (odd, I guess). Instead, you want:
{{{
def was_published_today(self):
return self.pub_date.date() == datetime.date.today().date()
}}}
Or something else that works.
--
Ticket URL: <https://code.djangoproject.com/ticket/16668>
Django <https://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.