#24747: Allow transforms in order_by
-------------------------------------+-------------------------------------
Reporter: sparkyb | Owner: nobody
Type: New feature | Status: new
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by jarshwah):
* cc: josh.smeaton@… (added)
* needs_better_patch: => 0
* needs_tests: => 0
* version: 1.8 => master
* needs_docs: => 0
* stage: Unreviewed => Accepted
Comment:
This is the general problem that matches these specific tickets:
https://code.djangoproject.com/ticket/24592
https://code.djangoproject.com/ticket/23709
And copying my comment from 24592:
There are possibly two ways to fix this situation.
1. Make all Transforms into Expressions. That is, we need to consolidate
the very close APIs of Transforms/Lookups and Expressions. We have and we
are discussing this elsewhere (though I can't find where just at the
moment). This is the most likely solution we'll converge on.
2. Make .values and .order_by understand the transformation/lookup API.
We'll probably steer clear of this as it helps to widen the gap between
transforms/expressions.
I now think we should implement both, although 2 will be dependent one 1
(where 1 is tracked here: https://code.djangoproject.com/ticket/24629).
The idea is that transforms should be expressions, and then converting the
transform syntax into the expression syntax internally would allow users
to use whichever syntax they'd prefer.
I'll close the other tickets that are asking for specific transforms and
leave this one open as it calls out the general issue.
--
Ticket URL: <https://code.djangoproject.com/ticket/24747#comment:1>
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/065.969484d2e60261f44ccee8a2e9429a91%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.