Author: jbronn Date: 2008-11-05 12:24:55 -0600 (Wed, 05 Nov 2008) New Revision: 9339
Modified: django/branches/releases/1.0.X/django/contrib/gis/db/models/sql/query.py django/branches/releases/1.0.X/django/contrib/gis/sitemaps/ Log: [1.0.X] Fixed `resolve_columns` so that pagination works again on Oracle GeoQuerySets; properly set svn:ignore on `sitemaps` subdir. Backport of r9338 from trunk. Modified: django/branches/releases/1.0.X/django/contrib/gis/db/models/sql/query.py =================================================================== --- django/branches/releases/1.0.X/django/contrib/gis/db/models/sql/query.py 2008-11-05 18:15:48 UTC (rev 9338) +++ django/branches/releases/1.0.X/django/contrib/gis/db/models/sql/query.py 2008-11-05 18:24:55 UTC (rev 9339) @@ -172,11 +172,21 @@ """ values = [] aliases = self.extra_select.keys() - index_start = len(aliases) + + # Have to set a starting row number offset that is used for + # determining the correct starting row index -- needed for + # doing pagination with Oracle. + rn_offset = 0 + if SpatialBackend.oracle: + if self.high_mark is not None or self.low_mark: rn_offset = 1 + index_start = rn_offset + len(aliases) + + # Converting any extra selection values (e.g., geometries and + # distance objects added by GeoQuerySet methods). values = [self.convert_values(v, self.extra_select_fields.get(a, None)) - for v, a in izip(row[:index_start], aliases)] + for v, a in izip(row[rn_offset:index_start], aliases)] if SpatialBackend.oracle: - # This is what happens normally in Oracle's `resolve_columns`. + # This is what happens normally in OracleQuery's `resolve_columns`. for value, field in izip(row[index_start:], fields): values.append(self.convert_values(value, field)) else: @@ -187,7 +197,7 @@ """ Using the same routines that Oracle does we can convert our extra selection objects into Geometry and Distance objects. - TODO: Laziness. + TODO: Make converted objects 'lazy' for less overhead. """ if SpatialBackend.oracle: # Running through Oracle's first. Property changes on: django/branches/releases/1.0.X/django/contrib/gis/sitemaps ___________________________________________________________________ Name: svn:ignore + *.pyc --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django updates" group. To post to this group, send email to django-updates@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-updates?hl=en -~----------~----~----~----~------~----~------~--~---