Re: [Django] #36648: "pk" exception when using first() on unordered queryset with aggregation does not consider composite pk fields provided separately (was: "pk" exception from guard against using first() on unordered queryset with aggregation does not consider composite pk fields provided separately)

2 views
Skip to first unread message

Django

unread,
Oct 8, 2025, 1:48:07 PM10/8/25
to django-...@googlegroups.com
#36648: "pk" exception when using first() on unordered queryset with aggregation
does not consider composite pk fields provided separately
-------------------------------------+-------------------------------------
Reporter: Jacob Walls | Owner: (none)
Type: Bug | Status: new
Component: Database layer | Version: 5.2
(models, ORM) |
Severity: Release blocker | Resolution:
Keywords: compositepk | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Natalia Bidart):

* summary:
"pk" exception from guard against using first() on unordered queryset
with aggregation does not consider composite pk fields provided
separately
=>
"pk" exception when using first() on unordered queryset with
aggregation does not consider composite pk fields provided separately

--
Ticket URL: <https://code.djangoproject.com/ticket/36648#comment:2>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
Reply all
Reply to author
Forward
0 new messages