Ticket #11741: django-gis.diff

File django-gis.diff, 1.8 KB (added by jaklaassen@…, 15 years ago)
  • django/contrib/gis/db/models/sql/where.py

     
    8787                # will be populated in the GeoFieldSQL object returned by the
    8888                # GeometryField.
    8989                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)
    9191                return gwc % value_annot.where, params
    9292            else:
    9393                raise TypeError('Invalid lookup type: %r' % lookup_type)
  • django/contrib/gis/db/backend/postgis/query.py

     
    1010from django.contrib.gis.measure import Distance
    1111from django.contrib.gis.db.backend.util import SpatialOperation, SpatialFunction
    1212
    13 qn = connection.ops.quote_name
    14 
    1513# Get the PostGIS version information.
    1614# To avoid the need to do a database query to determine the PostGIS version
    1715# each time the server starts up, one can optionally specify a
     
    250248    else: return exactly_two(val)
    251249
    252250#### The `get_geo_where_clause` function for PostGIS. ####
    253 def get_geo_where_clause(table_alias, name, lookup_type, geo_annot):
     251def get_geo_where_clause(table_alias, name, lookup_type, geo_annot, qn=connection.ops.quote_name):
    254252    "Returns the SQL WHERE clause for use in PostGIS SQL construction."
    255253    # Getting the quoted field as `geo_col`.
    256254    geo_col = '%s.%s' % (qn(table_alias), qn(name))
Back to Top