Ticket #11741: django-gis.diff
File django-gis.diff, 1.8 KB (added by , 15 years ago) |
---|
-
django/contrib/gis/db/models/sql/where.py
87 87 # will be populated in the GeoFieldSQL object returned by the 88 88 # GeometryField. 89 89 alias, col, db_type = obj 90 gwc = get_geo_where_clause(alias, col, lookup_type, value_annot )90 gwc = get_geo_where_clause(alias, col, lookup_type, value_annot, qn) 91 91 return gwc % value_annot.where, params 92 92 else: 93 93 raise TypeError('Invalid lookup type: %r' % lookup_type) -
django/contrib/gis/db/backend/postgis/query.py
10 10 from django.contrib.gis.measure import Distance 11 11 from django.contrib.gis.db.backend.util import SpatialOperation, SpatialFunction 12 12 13 qn = connection.ops.quote_name14 15 13 # Get the PostGIS version information. 16 14 # To avoid the need to do a database query to determine the PostGIS version 17 15 # each time the server starts up, one can optionally specify a … … 250 248 else: return exactly_two(val) 251 249 252 250 #### The `get_geo_where_clause` function for PostGIS. #### 253 def get_geo_where_clause(table_alias, name, lookup_type, geo_annot ):251 def get_geo_where_clause(table_alias, name, lookup_type, geo_annot, qn=connection.ops.quote_name): 254 252 "Returns the SQL WHERE clause for use in PostGIS SQL construction." 255 253 # Getting the quoted field as `geo_col`. 256 254 geo_col = '%s.%s' % (qn(table_alias), qn(name))