#28568 closed Uncategorized (fixed)
Example in reference of Database Functions leads to NameError
Description ¶
The following example (just above https://docs.djangoproject.com/en/1.11/ref/models/database-functions/#trunc) leads to a NameError
, because melb
is not defined.
>>> import pytz >>> tzinfo = pytz.timezone('Australia/Melbourne') >>> Experiment.objects.annotate( ... day=ExtractDay('start_datetime', tzinfo=melb), ... weekday=ExtractWeekDay('start_datetime', tzinfo=melb), ... hour=ExtractHour('start_datetime', tzinfo=melb), ... ).values('day', 'weekday', 'hour').get( ... end_datetime__year=ExtractYear('start_datetime'), ... )
Change History (5)
comment:1 by , 7 years ago
Component: | Uncategorized → Documentation |
---|---|
Has patch: | set |
comment:2 by , 7 years ago
Version: | 1.11 → master |
---|
Note:
See TracTickets
for help on using tickets.
pull request: https://github.com/django/django/pull/9022