mirror of
https://github.com/django/django.git
synced 2025-08-19 02:01:29 +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:
parent
c38d8f0f87
commit
70ff455a35
5 changed files with 25 additions and 1 deletions
|
@ -12,6 +12,9 @@ class WKTAdapter(object):
|
|||
return False
|
||||
return self.wkt == other.wkt and self.srid == other.srid
|
||||
|
||||
def __hash__(self):
|
||||
return hash((self.wkt, self.srid))
|
||||
|
||||
def __str__(self):
|
||||
return self.wkt
|
||||
|
||||
|
|
|
@ -28,6 +28,9 @@ class PostGISAdapter(object):
|
|||
return False
|
||||
return (self.ewkb == other.ewkb) and (self.srid == other.srid)
|
||||
|
||||
def __hash__(self):
|
||||
return hash((self.ewkb, self.srid))
|
||||
|
||||
def __str__(self):
|
||||
return self.getquoted()
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue