1
0
mirror of https://github.com/django/django.git synced 2025-08-07 18:39:13 +00:00

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
This commit is contained in:
Anssi Kääriäinen 2012-11-15 21:33:56 +02:00
parent 1194a96999
commit 7cfb567e45

View File

@ -101,7 +101,7 @@ class GeoSQLCompiler(compiler.SQLCompiler):
return result return result
def get_default_columns(self, with_aliases=False, col_aliases=None, 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 Computes the default columns for selecting every field in the base
model. Will sometimes be called to pull in related models (e.g. via model. Will sometimes be called to pull in related models (e.g. via
@ -127,7 +127,7 @@ class GeoSQLCompiler(compiler.SQLCompiler):
if start_alias: if start_alias:
seen = {None: start_alias} seen = {None: start_alias}
for field, model in opts.get_fields_with_model(): 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 continue
if start_alias: if start_alias:
try: try: