Opened 6 years ago
Closed 6 years ago
#30345 closed Cleanup/optimization (worksforme)
documentation mistake
Reported by: | RoninFromMoscow | Owned by: | nobody |
---|---|---|---|
Component: | Documentation | Version: | dev |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
https://docs.djangoproject.com/en/2.2/intro/tutorial02/
this line leads to "Expected type 'timedelta', got 'DateTimeField' instead" message
return self.pub_date >= timezone.now() - datetime.timedelta(days=1)
passible solution:
return self.pub_date >= (timezone.now() - datetime.timedelta(days=1)).timestamp()
Change History (1)
comment:1 by , 6 years ago
Resolution: | → worksforme |
---|---|
Status: | new → closed |
Type: | Bug → Cleanup/optimization |
Version: | 2.2 → master |
Note:
See TracTickets
for help on using tickets.
Thanks for the report, however tutorial works perfectly for me. Please use one of support channels if it's still doesn't work for you.