summaryrefslogtreecommitdiff
path: root/django/contrib/gis/db/models/sql
diff options
context:
space:
mode:
authorJustin Bronn <jbronn@gmail.com>2009-04-14 19:14:32 +0000
committerJustin Bronn <jbronn@gmail.com>2009-04-14 19:14:32 +0000
commitbd8afb18940b3e4f711b714dd20abf1053e31e70 (patch)
tree2531c4e6a0590992a0c97cefb0ab6500e11f2a74 /django/contrib/gis/db/models/sql
parent9a9c552f6f0103d0c6555f25683f18db63f256f8 (diff)
Fixed #10807 - `GeoWhereNode` no longer passes `Constraint` objects to where they shouldn't go.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10559 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/contrib/gis/db/models/sql')
-rw-r--r--django/contrib/gis/db/models/sql/where.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/django/contrib/gis/db/models/sql/where.py b/django/contrib/gis/db/models/sql/where.py
index 61c01d2902..ff6f45816c 100644
--- a/django/contrib/gis/db/models/sql/where.py
+++ b/django/contrib/gis/db/models/sql/where.py
@@ -76,17 +76,18 @@ class GeoWhereNode(WhereNode):
# the `get_geo_where_clause` to construct the appropriate
# spatial SQL when `make_atom` is called.
annotation = GeoAnnotation(field, value, where)
- return super(WhereNode, self).add((obj, lookup_type, annotation, params), connector)
+ return super(WhereNode, self).add(((alias, col, field.db_type()), lookup_type, annotation, params), connector)
def make_atom(self, child, qn):
- lvalue, lookup_type, value_annot, params = child
+ obj, lookup_type, value_annot, params = child
if isinstance(value_annot, GeoAnnotation):
if lookup_type in SpatialBackend.gis_terms:
# Getting the geographic where clause; substitution parameters
# will be populated in the GeoFieldSQL object returned by the
# GeometryField.
- gwc = get_geo_where_clause(lvalue.alias, lvalue.col, lookup_type, value_annot)
+ alias, col, db_type = obj
+ gwc = get_geo_where_clause(alias, col, lookup_type, value_annot)
return gwc % value_annot.where, params
else:
raise TypeError('Invalid lookup type: %r' % lookup_type)