diff options
| author | Justin Bronn <jbronn@gmail.com> | 2008-07-08 18:46:09 +0000 |
|---|---|---|
| committer | Justin Bronn <jbronn@gmail.com> | 2008-07-08 18:46:09 +0000 |
| commit | 6d77419deb5914370822433ec01bec8b561e7620 (patch) | |
| tree | 30c0e7e6d5365d3fba3a107b1ab5d2b99e41fc4b | |
| parent | 822a1259f6d81392035e6698e6386b9639e14eec (diff) | |
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
| -rw-r--r-- | django/contrib/gis/db/backend/oracle/query.py | 4 | ||||
| -rw-r--r-- | django/contrib/gis/db/models/sql/query.py | 4 |
2 files changed, 4 insertions, 4 deletions
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: |
