1
0
mirror of https://github.com/django/django.git synced 2025-07-04 17:59:13 +00:00

gis: Fixed bug in GeoQuery.get_default_columns; forgot to make Oracle spatial lookup terms structure a dictionary.

git-svn-id: http://code.djangoproject.com/svn/django/branches/gis@7870 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Justin Bronn 2008-07-08 18:46:09 +00:00
parent 822a1259f6
commit 6d77419deb
2 changed files with 4 additions and 4 deletions

View File

@ -104,10 +104,10 @@ ORACLE_GEOMETRY_FUNCTIONS.update(DISTANCE_FUNCTIONS)
# This lookup type does not require a mapping.
MISC_TERMS = ['isnull']
# Assacceptable lookup types for Oracle spatial.
# Acceptable lookup types for Oracle spatial.
ORACLE_SPATIAL_TERMS = ORACLE_GEOMETRY_FUNCTIONS.keys()
ORACLE_SPATIAL_TERMS += MISC_TERMS
ORACLE_SPATIAL_TERMS = tuple(ORACLE_SPATIAL_TERMS) # Making immutable
ORACLE_SPATIAL_TERMS = dict((term, None) for term in ORACLE_SPATIAL_TERMS) # Making dictionary for fast lookups
#### The `get_geo_where_clause` function for Oracle ####
def get_geo_where_clause(table_alias, name, lookup_type, geo_annot):

View File

@ -10,7 +10,7 @@ from django.contrib.gis.measure import Area, Distance
# Valid GIS query types.
ALL_TERMS = sql.constants.QUERY_TERMS.copy()
ALL_TERMS.update(dict([(term, None) for term in SpatialBackend.gis_terms]))
ALL_TERMS.update(SpatialBackend.gis_terms)
class GeoQuery(sql.Query):
"""
@ -125,7 +125,7 @@ class GeoQuery(sql.Query):
root_pk = self.model._meta.pk.column
seen = {None: table_alias}
aliases = set()
for field, model in self.model._meta.get_fields_with_model():
for field, model in opts.get_fields_with_model():
try:
alias = seen[model]
except KeyError: