#9137 closed (invalid)
Tutorial 1 has a small mistake
| Reported by: | Owned by: | nobody | |
|---|---|---|---|
| Component: | Documentation | Version: | 1.0 |
| 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 |
Description
def was_published_today(self):
return self.pub_date.date() == datetime.date.today()
That doesn't seem to work for me,
def was_published_today(self):
return self.pub_date == datetime.date.today()
Does.
Note:
See TracTickets
for help on using tickets.
If you incorrectly made the field a DateField instead of a DateTimeField, your version would work, but the tutorial shows a DateTimeField, so the .date() is required