Fixed #12344 -- Using `select_related()` on geographic fields with the Oracle spatial backend now works.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@12022 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Justin Bronn 2009-12-29 10:18:56 +00:00
parent 4ab21fbf40
commit a488589461
2 changed files with 2 additions and 4 deletions

View File

@ -191,8 +191,8 @@ class GeoSQLCompiler(compiler.SQLCompiler):
if self.connection.ops.oracle or getattr(self.query, 'geo_values', False):
# We resolve the rest of the columns if we're on Oracle or if
# the `geo_values` attribute is defined.
for value, field in izip(row[index_start:], fields):
values.append(self.query.convert_values(value, field, self.connection))
for value, field in map(None, row[index_start:], fields):
values.append(self.query.convert_values(value, field, connection=self.connection))
else:
values.extend(row[index_start:])
return tuple(values)

View File

@ -19,7 +19,6 @@ class RelatedGeoModelTest(unittest.TestCase):
loc = Location.objects.create(point=Point(lon, lat))
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):
"Testing `select_related` on geographic models (see #7126)."
qs1 = City.objects.all()
@ -34,7 +33,6 @@ class RelatedGeoModelTest(unittest.TestCase):
self.assertEqual(Point(lon, lat), c.location.point)
@no_mysql
@no_oracle # Pagination problem is implicated in this test as well.
def test03_transform_related(self):
"Testing the `transform` GeoQuerySet method on related geographic models."
# All the transformations are to state plane coordinate systems using