Allow expressions to be used in order_by queryset method
Now that expressions have landed, we should try to expand the scope of queryset methods where they are allowed as arguments. There is a proof of concept for allowing order_by to accept expressions here: https://groups.google.com/forum/#!topic/django-developers/arR7B_Luszc
I'm marking this as 1.8, as I plan to clean up the patch and have it ready before the alpha. If it doesn't make it in time, we can change the version.
Change History
(8)
Cc: |
josh.smeaton@… added
|
Owner: |
set to Josh Smeaton
|
Status: |
new → assigned
|
Triage Stage: |
Unreviewed → Accepted
|
Type: |
Uncategorized → New feature
|
Has patch: |
set
|
Needs documentation: |
set
|
Needs tests: |
set
|
Patch needs improvement: |
set
|
Keywords: |
1.8-alpha added
|
Needs documentation: |
unset
|
Needs tests: |
unset
|
Patch needs improvement: |
unset
|
Triage Stage: |
Accepted → Ready for checkin
|
Resolution: |
→ fixed
|
Status: |
assigned → closed
|
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:
then .order_by(NullsLast('somecol')).reverse() should produce SQL like: