#36644: Enable using an empty order_by() to disable implicit primary key
ordering
in first()
-------------------------------------+-------------------------------------
Reporter: Lily | Owner: Nilesh
| Pahari
Type: New feature | Status: assigned
Component: Database layer | Version: dev
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Jacob Walls):
* needs_docs: 1 => 0
* stage: Accepted => Ready for checkin
Comment:
Update: the `union()` stuff mentioned above turned out to be a symptom of
a separate bug:
Default orderings weren't applied after a `union()`, due to the particular
way that `clear_ordering(force=True, clear_default=False)` doesn't
actually reset `QuerySet.default_ordering` back to `True`; it must be done
manually. (A call to `order_by()` with no args does that manually.)
I segregated out Nilesh's fix for the `union()` behavior into a separate
commit.
Then, we were able to do the primary fix for the `order_by()` <-->
`first()` interaction without any unexpected behavior changes.
--
Ticket URL: <https://code.djangoproject.com/ticket/36644#comment:10>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion visit
https://groups.google.com/d/msgid/django-updates/0107019c2fef29ca-177ec73d-1894-4a11-b464-00a1f24b361f-000000%40eu-central-1.amazonses.com.