[Django] #33959: Missing import in "Expressions can reference transforms" section

8 views
Skip to first unread message

Django

unread,
Aug 28, 2022, 3:42:55 AM8/28/22
to django-...@googlegroups.com
#33959: Missing import in "Expressions can reference transforms" section
-----------------------------------------+------------------------
Reporter: Eido Askayo | Owner: nobody
Type: Bug | Status: new
Component: Documentation | Version: 4.0
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 |
-----------------------------------------+------------------------
In section [https://docs.djangoproject.com/en/4.0/topics/db/queries
/#expressions-can-reference-transforms Expressions can reference
transforms], the following code is shown:
{{{
>>> Entry.objects.values('pub_date__year').annotate(
... top_rating=Subquery(
... Entry.objects.filter(
... pub_date__year=OuterRef('pub_date__year')
... ).order_by('-rating').values('rating')[:1]
... ),
... total_comments=Sum('number_of_comments'))
}}}
There are missing imports for {{{Subquery}}}, {{{OuterRef}}} and {{{Sum}}}
functions:
{{{
>>> from django.db.models import Subquery, OuterRef, Sum
}}}

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

Django

unread,
Aug 28, 2022, 4:27:15 PM8/28/22
to django-...@googlegroups.com
#33959: Missing import in "Expressions can reference transforms" section
-------------------------------------+-------------------------------------
Reporter: Eido Askayo | Owner: Iván
| Camilo Triviño López
Type: Bug | Status: assigned
Component: Documentation | Version: 4.0
Severity: Normal | Resolution:

Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Iván Camilo Triviño López):

* owner: nobody => Iván Camilo Triviño López
* status: new => assigned


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

Django

unread,
Aug 29, 2022, 12:37:44 AM8/29/22
to django-...@googlegroups.com
#33959: Missing import in "Expressions can reference transforms" section
-------------------------------+----------------------------------------
Reporter: Eido Askayo | Owner: Iván Triviño
Type: Bug | Status: closed
Component: Documentation | Version: 4.0
Severity: Normal | Resolution: duplicate

Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+----------------------------------------
Changes (by Mariusz Felisiak):

* status: assigned => closed
* resolution: => duplicate


Comment:

Duplicate of #33958.

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

Reply all
Reply to author
Forward
0 new messages