[Django] #34330: QuerySet of a model having Meta.ordering, returns the sortable field in values_list() and values()

2 views
Skip to first unread message

Django

unread,
Feb 10, 2023, 7:22:12 AM2/10/23
to django-...@googlegroups.com
#34330: QuerySet of a model having Meta.ordering, returns the sortable field in
values_list() and values()
-----------------------------------------+------------------------
Reporter: r_valeev | Owner: nobody
Type: Bug | Status: new
Component: Uncategorized | Version: 2.2
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 |
-----------------------------------------+------------------------
If you pass a Queryset to Subquery(), whose model has Meta.ordering, then
the fields declared in ordering will be added to the result of values() or
values_list() imperceptibly, then the error "Subquery returns more than 1
row" is raised

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

Django

unread,
Feb 10, 2023, 11:44:06 AM2/10/23
to django-...@googlegroups.com
#34330: QuerySet of a model having Meta.ordering, returns the sortable field in
values_list() and values()
-------------------------------------+-------------------------------------

Reporter: r_valeev | Owner: nobody
Type: Bug | Status: new
Component: Database layer | Version: 2.2
(models, ORM) |
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 r_valeev):

* component: Uncategorized => Database layer (models, ORM)


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

Django

unread,
Feb 10, 2023, 1:46:57 PM2/10/23
to django-...@googlegroups.com
#34330: QuerySet of a model having Meta.ordering, returns the sortable field in
values_list() and values()
-------------------------------------+-------------------------------------
Reporter: r_valeev | Owner: nobody
Type: Bug | Status: closed

Component: Database layer | Version: 2.2
(models, ORM) |
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: new => closed
* resolution: => duplicate


Comment:

As far as I'm aware it's a duplicate of #14357, fixed in Django 3.1+.

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

Reply all
Reply to author
Forward
0 new messages