Changeset 7836 for django/branches/gis/django/contrib/gis/db/backend/mysql
- Timestamp:
- 07/04/08 15:16:22 (5 months ago)
- Files:
-
- django/branches/gis (modified) (1 prop)
- django/branches/gis/django/contrib/gis/db/backend/mysql/query.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/branches/gis
- Property svnmerge-integrated changed from /django/trunk:1-7767 to /django/trunk:1-7835
django/branches/gis/django/contrib/gis/db/backend/mysql/query.py
r7699 r7836 39 39 MYSQL_GIS_TERMS = MYSQL_GIS_FUNCTIONS.keys() 40 40 MYSQL_GIS_TERMS += MISC_TERMS 41 MYSQL_GIS_TERMS = tuple(MYSQL_GIS_TERMS) # Making immutable41 MYSQL_GIS_TERMS = dict((term, None) for term in MYSQL_GIS_TERMS) # Making dictionary 42 42 43 def get_geo_where_clause( lookup_type, table_prefix, field, value):43 def get_geo_where_clause(table_alias, name, lookup_type, geo_annot): 44 44 "Returns the SQL WHERE clause for use in MySQL spatial SQL construction." 45 45 # Getting the quoted field as `geo_col`. 46 geo_col = '%s.%s' % (qn(table_ prefix), qn(field.column))46 geo_col = '%s.%s' % (qn(table_alias), qn(name)) 47 47 48 48 # See if a MySQL Geometry function matches the lookup type next … … 55 55 # geometries in its spatial indices. 56 56 if lookup_type == 'isnull': 57 return "%s IS %sNULL" % (geo_col, (not value and 'NOT ' or ''))57 return "%s IS %sNULL" % (geo_col, (not geo_annot.value and 'NOT ' or '')) 58 58 59 59 raise TypeError("Got invalid lookup_type: %s" % repr(lookup_type))
