Commit db867be9 authored by Justin Bronn's avatar Justin Bronn
Browse files

[1.1.X] Fixed #12344 -- Using `select_related()` on geographic fields with the...

[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
parent 58bf653a
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -229,7 +229,7 @@ class GeoQuery(sql.Query):
        if SpatialBackend.oracle or getattr(self, '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):
            for value, field in map(None, row[index_start:], fields):
                values.append(self.convert_values(value, field))
        else:
            values.extend(row[index_start:])
+0 −2
Original line number Diff line number Diff line
@@ -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