summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnssi Kääriäinen <akaariai@gmail.com>2012-12-30 12:22:26 +0200
committerAnssi Kääriäinen <akaariai@gmail.com>2012-12-30 12:22:26 +0200
commite871e0217838ee0a7a47ec1bdf81add5198227e7 (patch)
tree2bab25075a42222c6f8fa2e2bf765b33d45e451f
parent9e5ada79bf2d25fa862babe74517a6c7b5b89968 (diff)
[1.5.x] Made gis get_default_columns mirror changes in normal compiler
The copy-pasted part of gis compiler's get_default_columns wasn't changed to match changes in a0155f35343afbfd9e98ab9aa4615f06780f697e.
-rw-r--r--django/contrib/gis/db/models/sql/compiler.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/django/contrib/gis/db/models/sql/compiler.py b/django/contrib/gis/db/models/sql/compiler.py
index cf6a8ad047..6ab927bd56 100644
--- a/django/contrib/gis/db/models/sql/compiler.py
+++ b/django/contrib/gis/db/models/sql/compiler.py
@@ -119,14 +119,16 @@ class GeoSQLCompiler(compiler.SQLCompiler):
result = []
if opts is None:
opts = self.query.model._meta
- # Skip all proxy to the root proxied model
- opts = opts.concrete_model._meta
aliases = set()
only_load = self.deferred_to_columns()
if start_alias:
seen = {None: start_alias}
for field, model in opts.get_fields_with_model():
+ # For local fields (even if through proxy) the model should
+ # be None.
+ if model == opts.concrete_model:
+ model = None
if local_only and model is not None:
continue
if start_alias: