From e871e0217838ee0a7a47ec1bdf81add5198227e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anssi=20K=C3=A4=C3=A4ri=C3=A4inen?= Date: Sun, 30 Dec 2012 12:22:26 +0200 Subject: [PATCH] [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. --- django/contrib/gis/db/models/sql/compiler.py | 6 ++++-- 1 file 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: