Ticket #13934: gis-local_only.patch
File gis-local_only.patch, 1.4 KB (added by , 14 years ago) |
---|
-
django/contrib/gis/db/models/sql/compiler.py
old new class GeoSQLCompiler(compiler.SQLCompile 95 95 return result 96 96 97 97 def get_default_columns(self, with_aliases=False, col_aliases=None, 98 start_alias=None, opts=None, as_pairs=False): 98 start_alias=None, opts=None, as_pairs=False, 99 local_only=False): 99 100 """ 100 101 Computes the default columns for selecting every field in the base 101 102 model. Will sometimes be called to pull in related models (e.g. via … … class GeoSQLCompiler(compiler.SQLCompile 113 114 result = [] 114 115 if opts is None: 115 116 opts = self.query.model._meta 117 qn = self.quote_name_unless_alias 118 qn2 = self.connection.ops.quote_name 116 119 aliases = set() 117 120 only_load = self.deferred_to_columns() 118 121 # Skip all proxy to the root proxied model … … class GeoSQLCompiler(compiler.SQLCompile 121 124 if start_alias: 122 125 seen = {None: start_alias} 123 126 for field, model in opts.get_fields_with_model(): 127 if local_only and model is not None: 128 continue 124 129 if start_alias: 125 130 try: 126 131 alias = seen[model]