diff --git a/django/contrib/gis/db/backend/oracle/query.py b/django/contrib/gis/db/backend/oracle/query.py index a073b7b45f..35e30d40eb 100644 --- a/django/contrib/gis/db/backend/oracle/query.py +++ b/django/contrib/gis/db/backend/oracle/query.py @@ -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): diff --git a/django/contrib/gis/db/models/sql/query.py b/django/contrib/gis/db/models/sql/query.py index 20f695b26f..b4892e3c15 100644 --- a/django/contrib/gis/db/models/sql/query.py +++ b/django/contrib/gis/db/models/sql/query.py @@ -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: