[Django] #28568: Example in reference of Database Functions leads to NameError

23 views
Skip to first unread message

Django

unread,
Sep 4, 2017, 12:02:01 PM9/4/17
to django-...@googlegroups.com
#28568: Example in reference of Database Functions leads to NameError
-----------------------------------------+------------------------
Reporter: Michael Käufl | Owner: nobody
Type: Uncategorized | Status: new
Component: Uncategorized | Version: 1.11
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-----------------------------------------+------------------------
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'),
... )
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/28568>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Sep 4, 2017, 12:03:50 PM9/4/17
to django-...@googlegroups.com
#28568: Example in reference of Database Functions leads to NameError
-------------------------------+--------------------------------------

Reporter: Michael Käufl | Owner: nobody
Type: Uncategorized | Status: new
Component: Documentation | Version: 1.11
Severity: Normal | Resolution:
Keywords: | Triage Stage: Unreviewed
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------------------------
Changes (by Michael Käufl):

* has_patch: 0 => 1
* component: Uncategorized => Documentation


Comment:

pull request: https://github.com/django/django/pull/9022

--
Ticket URL: <https://code.djangoproject.com/ticket/28568#comment:1>

Django

unread,
Sep 4, 2017, 12:32:43 PM9/4/17
to django-...@googlegroups.com
#28568: Example in reference of Database Functions leads to NameError
-------------------------------+--------------------------------------

Reporter: Michael Käufl | Owner: nobody
Type: Uncategorized | Status: new
Component: Documentation | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Unreviewed
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------------------------
Changes (by Michael Käufl):

* version: 1.11 => master


--
Ticket URL: <https://code.djangoproject.com/ticket/28568#comment:2>

Django

unread,
Sep 4, 2017, 2:41:12 PM9/4/17
to django-...@googlegroups.com
#28568: Example in reference of Database Functions leads to NameError
-------------------------------+--------------------------------------

Reporter: Michael Käufl | Owner: nobody
Type: Uncategorized | Status: closed
Component: Documentation | Version: master
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Unreviewed
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------------------------
Changes (by Tim Graham <timograham@…>):

* status: new => closed
* resolution: => fixed


Comment:

In [changeset:"3f2b1d926bb3a72b4c3d2cd958455ebb9b4ca458" 3f2b1d92]:
{{{
#!CommitTicketReference repository=""
revision="3f2b1d926bb3a72b4c3d2cd958455ebb9b4ca458"
Fixed #28568 -- Fixed typo in docs/ref/models/database-functions.txt.

And made an example use naming consistent with the rest of the doc.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/28568#comment:3>

Django

unread,
Sep 4, 2017, 2:41:31 PM9/4/17
to django-...@googlegroups.com
#28568: Example in reference of Database Functions leads to NameError
-------------------------------+--------------------------------------

Reporter: Michael Käufl | Owner: nobody
Type: Uncategorized | Status: closed
Component: Documentation | Version: master
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Unreviewed
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------------------------

Comment (by Tim Graham <timograham@…>):

In [changeset:"ddea2166f1db776dadbc26751b8ceaba3cace6b5" ddea2166]:
{{{
#!CommitTicketReference repository=""
revision="ddea2166f1db776dadbc26751b8ceaba3cace6b5"
[1.11.x] Fixed #28568 -- Fixed typo in docs/ref/models/database-
functions.txt.

And made an example use naming consistent with the rest of the doc.

Backport of 3f2b1d926bb3a72b4c3d2cd958455ebb9b4ca458 from master
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/28568#comment:4>

Django

unread,
Sep 4, 2017, 2:42:34 PM9/4/17
to django-...@googlegroups.com
#28568: Example in reference of Database Functions leads to NameError
-------------------------------+--------------------------------------

Reporter: Michael Käufl | Owner: nobody
Type: Uncategorized | Status: closed
Component: Documentation | Version: master
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Unreviewed
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------------------------

Comment (by Tim Graham <timograham@…>):

In [changeset:"db7dfbff53765bb42b51314b4d48d11e42a218db" db7dfbff]:
{{{
#!CommitTicketReference repository=""
revision="db7dfbff53765bb42b51314b4d48d11e42a218db"
[1.10.x] Fixed #28568 -- Fixed typo in docs/ref/models/database-
functions.txt.

And made an example use naming consistent with the rest of the doc.

Backport of 3f2b1d926bb3a72b4c3d2cd958455ebb9b4ca458 from master
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/28568#comment:5>

Reply all
Reply to author
Forward
0 new messages