Opened 5 years ago

Closed 5 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 Mariusz Felisiak, 5 years ago

Resolution: worksforme
Status: newclosed
Type: BugCleanup/optimization
Version: 2.2master

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.

Note: See TracTickets for help on using tickets.
Back to Top