From 7cfb567e457379f52a80fe0e8d98dd8191391c6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anssi=20K=C3=A4=C3=A4ri=C3=A4inen?= Date: Thu, 15 Nov 2012 21:33:56 +0200 Subject: [PATCH] Another regression fix for select_related handling This time gis compiler.get_default_columns() wasn't up to date. Thanks to CI another regression fixed. Refs #13781 --- django/contrib/gis/db/models/sql/compiler.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/django/contrib/gis/db/models/sql/compiler.py b/django/contrib/gis/db/models/sql/compiler.py index 0dcf50d32a..81a9941c9e 100644 --- a/django/contrib/gis/db/models/sql/compiler.py +++ b/django/contrib/gis/db/models/sql/compiler.py @@ -101,7 +101,7 @@ class GeoSQLCompiler(compiler.SQLCompiler): return result def get_default_columns(self, with_aliases=False, col_aliases=None, - start_alias=None, opts=None, as_pairs=False, local_only=False): + start_alias=None, opts=None, as_pairs=False, from_parent=None): """ Computes the default columns for selecting every field in the base model. Will sometimes be called to pull in related models (e.g. via @@ -127,7 +127,7 @@ class GeoSQLCompiler(compiler.SQLCompiler): if start_alias: seen = {None: start_alias} for field, model in opts.get_fields_with_model(): - if local_only and model is not None: + if from_parent and model is not None and issubclass(from_parent, model): continue if start_alias: try: