summaryrefslogtreecommitdiff
path: root/django
diff options
context:
space:
mode:
authorMariusz Felisiak <felisiak.mariusz@gmail.com>2018-01-27 11:12:11 +0100
committerGitHub <noreply@github.com>2018-01-27 11:12:11 +0100
commitb002a032f90b8cd228cfcee6c88cd238a8191cc0 (patch)
treeba2229bbf9a92f5b45e30e1377610ca572ed616f /django
parent3187c89d6f8c60ca7e78093d5b37e0709e71cea9 (diff)
Fixed #29054 -- Fixed a regression where a queryset that annotates with geometry objects crashes.
Made GEOSGeometryBase hashable. Regression in 19b2dfd1bfe7fd716dd3d8bfa5f972070d83b42f. Thanks Tim Graham for the review.
Diffstat (limited to 'django')
-rw-r--r--django/contrib/gis/geos/geometry.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/django/contrib/gis/geos/geometry.py b/django/contrib/gis/geos/geometry.py
index bcda25fa2f..1ebecc864b 100644
--- a/django/contrib/gis/geos/geometry.py
+++ b/django/contrib/gis/geos/geometry.py
@@ -144,6 +144,9 @@ class GEOSGeometryBase(GEOSBase):
return False
return isinstance(other, GEOSGeometry) and self.srid == other.srid and self.equals_exact(other)
+ def __hash__(self):
+ return hash((self.srid, self.wkt))
+
# ### Geometry set-like operations ###
# Thanks to Sean Gillies for inspiration:
# http://lists.gispython.org/pipermail/community/2007-July/001034.html