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:
parent
4ab21fbf40
commit
a488589461
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue