mirror of
https://github.com/django/django.git
synced 2025-10-31 09:41:08 +00:00
[1.8.x] Fixed #24615 -- ordering by expression not part of SELECT
Fixed queries where an expression was used in order_by() but the
expression wasn't in the query's select clause (for example the
expression could be masked by .values() call)
Thanks to Trac alias MattBlack85 for the report.
Backport of fb5c7748da from master.
This commit is contained in:
committed by
Claude Paroz
parent
c38d8f0f87
commit
70ff455a35
@@ -49,3 +49,7 @@ Bugfixes
|
||||
remove usage of referencing views by dotted path in
|
||||
:func:`~django.conf.urls.url` which is deprecated in Django 1.8
|
||||
(:ticket:`24635`).
|
||||
|
||||
* Fixed queries where an expression was referenced in ``order_by()``, but wasn't
|
||||
part of the select clause. An example query is
|
||||
``qs.annotate(foo=F('field')).values('pk').order_by('foo'))`` (:ticket:`24615`).
|
||||
|
||||
Reference in New Issue
Block a user