Skip to content
Browse files

Fixed a regression in gis introduced by Query.select_fields removal

  • Loading branch information...
1 parent 0d8432d commit 92fc263a2898b804c3b46447fd47e2898fbf8ff1 @akaariai akaariai committed Nov 2, 2012
Showing with 4 additions and 2 deletions.
  1. +4 −2 django/contrib/gis/db/models/
6 django/contrib/gis/db/models/
@@ -760,8 +760,10 @@ def _geocol_select(self, geo_field, field_name):
compiler = self.query.get_compiler(self.db)
- rel_table, rel_col = self.query.related_select_cols[self.query.related_select_fields.index(geo_field)]
- return compiler._field_column(geo_field, rel_table)
+ for (rel_table, rel_col), field in self.query.related_select_cols:
+ if field == geo_field:
+ return compiler._field_column(geo_field, rel_table)
+ raise ValueError("%r not in self.query.related_select_cols" % geo_field)
elif not geo_field in opts.local_fields:
# This geographic field is inherited from another model, so we have to
# use the db table for the _parent_ model instead.

0 comments on commit 92fc263

Please sign in to comment.
Something went wrong with that request. Please try again.