#24060: Allow expressions to be used in order_by queryset method
-------------------------------------+-------------------------------------
Reporter: jarshwah | Owner: jarshwah
Type: New feature | Status: assigned
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution:
Keywords: expressions | 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 akaariai):
One case to be aware: QuerySet.reverse(). This should work for any custom
expression order_by, too. This means that if
.order_by(NullsLast('somecol')) produces SQL like:
{{{
SELECT ... FROM ... ORDER BY somecol ASC NULLS LAST
}}}
then .order_by(NullsLast('somecol')).reverse() should produce SQL like:
{{{
SELECT ... FROM ... ORDER BY somecol DESC NULLS FIRST
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/24060#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 post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/066.6ba54a2b947519d34f8b2a4e2e2e19c7%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.