#31573: Support update().order_by() on MySQL.
-------------------------------------+-------------------------------------
Reporter: Gerben Morsink | Owner: nobody
Type: New feature | Status: new
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution:
Keywords: update mysql order | Triage Stage: Accepted
order_by |
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Simon Charette):
For anyone interested in implementing this feature you'll have to override
the `as_sql` and `pre_sql_setup` method of
`django.db.models.sql.compiler.SQLUpdateCompiler` in
`django.db.backends.mysql.compiler.SQLUpdateCompiler` to
[https://github.com/django/django/blob/d51e090db2110f016dbca1d794c0d379b3df551b/django/db/models/sql/compiler.py#L1535
avoid clearing the ordering] and append the `ORDER BY` clause to
`super().as_sql()[0]`.
--
Ticket URL: <https://code.djangoproject.com/ticket/31573#comment:2>
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 on the web visit
https://groups.google.com/d/msgid/django-updates/064.c2502ea602018abb9e08d04cea567746%40djangoproject.com.