Opened 17 years ago
Closed 17 years ago
#4876 closed (invalid)
typo error
Reported by: | Owned by: | Jacob | |
---|---|---|---|
Component: | Documentation | Version: | 0.96 |
Severity: | Keywords: | ||
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
def was_published_today(self):
return self.pub_date.date() == datetime.today()
instead of
return self.pub_date.date() == datetime.date.today()
Note:
See TracTickets
for help on using tickets.
This example code is in tutorials 1 and 2.
There's no error here. You may have used "
from datetime import datetime
" rather than "import datetime
". The Python shell examples use the first import, but the models file should use the second. They could be normalized to avoid this confusion, but that's a separate issue.