Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Updated `GeoSQLCompiler.get_default_columns`.

  • Loading branch information...
commit 065b52f18e7016b385feb8ad3de5dafb72ad202d 1 parent 1c010ce
@jbronn jbronn authored
Showing with 5 additions and 8 deletions.
  1. +5 −8 django/contrib/gis/db/models/sql/compiler.py
View
13 django/contrib/gis/db/models/sql/compiler.py
@@ -119,10 +119,10 @@ def get_default_columns(self, with_aliases=False, col_aliases=None,
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()
- # Skip all proxy to the root proxied model
- proxied_model = opts.concrete_model
if start_alias:
seen = {None: start_alias}
@@ -133,12 +133,9 @@ def get_default_columns(self, with_aliases=False, col_aliases=None,
try:
alias = seen[model]
except KeyError:
- if model is proxied_model:
- alias = start_alias
- else:
- link_field = opts.get_ancestor_link(model)
- alias = self.query.join((start_alias, model._meta.db_table,
- link_field.column, model._meta.pk.column))
+ link_field = opts.get_ancestor_link(model)
+ alias = self.query.join((start_alias, model._meta.db_table,
+ link_field.column, model._meta.pk.column))
seen[model] = alias
else:
# If we're starting from the base model of the queryset, the
Please sign in to comment.
Something went wrong with that request. Please try again.