[1.1.X] Fixed #12344 -- Using select_related()
on geographic fields with the Oracle spatial backend now works.
Backport of r12022 from trunk. git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.1.X@12023 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
58bf653a26
commit
db867be91e
@ -229,7 +229,7 @@ class GeoQuery(sql.Query):
|
|||||||
if SpatialBackend.oracle or getattr(self, 'geo_values', False):
|
if SpatialBackend.oracle or getattr(self, 'geo_values', False):
|
||||||
# We resolve the rest of the columns if we're on Oracle or if
|
# We resolve the rest of the columns if we're on Oracle or if
|
||||||
# the `geo_values` attribute is defined.
|
# the `geo_values` attribute is defined.
|
||||||
for value, field in izip(row[index_start:], fields):
|
for value, field in map(None, row[index_start:], fields):
|
||||||
values.append(self.convert_values(value, field))
|
values.append(self.convert_values(value, field))
|
||||||
else:
|
else:
|
||||||
values.extend(row[index_start:])
|
values.extend(row[index_start:])
|
||||||
|
@ -19,7 +19,6 @@ class RelatedGeoModelTest(unittest.TestCase):
|
|||||||
loc = Location.objects.create(point=Point(lon, lat))
|
loc = Location.objects.create(point=Point(lon, lat))
|
||||||
c = City.objects.create(name=name, state=state, location=loc)
|
c = City.objects.create(name=name, state=state, location=loc)
|
||||||
|
|
||||||
@no_oracle # TODO: Fix select_related() problems w/Oracle and pagination.
|
|
||||||
def test02_select_related(self):
|
def test02_select_related(self):
|
||||||
"Testing `select_related` on geographic models (see #7126)."
|
"Testing `select_related` on geographic models (see #7126)."
|
||||||
qs1 = City.objects.all()
|
qs1 = City.objects.all()
|
||||||
@ -34,7 +33,6 @@ class RelatedGeoModelTest(unittest.TestCase):
|
|||||||
self.assertEqual(Point(lon, lat), c.location.point)
|
self.assertEqual(Point(lon, lat), c.location.point)
|
||||||
|
|
||||||
@no_mysql
|
@no_mysql
|
||||||
@no_oracle # Pagination problem is implicated in this test as well.
|
|
||||||
def test03_transform_related(self):
|
def test03_transform_related(self):
|
||||||
"Testing the `transform` GeoQuerySet method on related geographic models."
|
"Testing the `transform` GeoQuerySet method on related geographic models."
|
||||||
# All the transformations are to state plane coordinate systems using
|
# All the transformations are to state plane coordinate systems using
|
||||||
|
Loading…
x
Reference in New Issue
Block a user