Changeset 7699 for django/branches/gis/django/contrib/gis/db
- Timestamp:
- 06/19/08 01:00:13 (5 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/branches/gis/django/contrib/gis/db/backend/mysql/query.py
r7104 r7699 20 20 MYSQL_GIS_FUNCTIONS = { 21 21 'bbcontains' : 'MBRContains', # For consistency w/PostGIS API 22 'contained' : 'MBRWithin', # (ditto) 22 'bboverlaps' : 'MBROverlaps', # .. .. 23 'contained' : 'MBRWithin', # .. .. 23 24 'contains' : 'MBRContains', 24 25 'disjoint' : 'MBRDisjoint', django/branches/gis/django/contrib/gis/db/models/query.py
r7641 r7699 602 602 ForeignKey relation to the current model. 603 603 """ 604 # If this is an aggregate spatial query, the flag needs to be 605 # set on the `GeoQuery` object of this queryset. 606 if aggregate: self.query.aggregate = True 607 604 608 # Is this operation going to be on a related geographic field? 605 609 if not geo_field in self.model._meta.fields: … … 608 612 self.query.add_select_related([field_name]) 609 613 self.query.pre_sql_setup() 610 # Can't non-aggregate and aggregate selections together.611 if aggregate: self.query.aggregate = True612 614 rel_table, rel_col = self.query.related_select_cols[self.query.related_select_fields.index(geo_field)] 613 615 return self.query._field_column(geo_field, rel_table) django/branches/gis/django/contrib/gis/db/models/sql/query.py
r7641 r7699 148 148 return result, aliases 149 149 150 def get_ordering(self): 151 """ 152 This routine is overridden to disable ordering for aggregate 153 spatial queries. 154 """ 155 if not self.aggregate: 156 return super(GeoQuery, self).get_ordering() 157 else: 158 return () 159 150 160 def resolve_columns(self, row, fields=()): 151 161 """
