Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed #12344 -- Using `select_related()` on geographic fields with th…

…e Oracle spatial backend now works.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@12022 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit a488589461582d60a41326cd8a6ab28b96a9e19a 1 parent 4ab21fb
Justin Bronn authored December 29, 2009
4  django/contrib/gis/db/models/sql/compiler.py
@@ -191,8 +191,8 @@ def resolve_columns(self, row, fields=()):
191 191
         if self.connection.ops.oracle or getattr(self.query, 'geo_values', False):
192 192
             # We resolve the rest of the columns if we're on Oracle or if
193 193
             # the `geo_values` attribute is defined.
194  
-            for value, field in izip(row[index_start:], fields):
195  
-                values.append(self.query.convert_values(value, field, self.connection))
  194
+            for value, field in map(None, row[index_start:], fields):
  195
+                values.append(self.query.convert_values(value, field, connection=self.connection))
196 196
         else:
197 197
             values.extend(row[index_start:])
198 198
         return tuple(values)
2  django/contrib/gis/tests/relatedapp/tests.py
@@ -19,7 +19,6 @@ def test01_setup(self):
19 19
             loc = Location.objects.create(point=Point(lon, lat))
20 20
             c = City.objects.create(name=name, state=state, location=loc)
21 21
 
22  
-    @no_oracle # TODO: Fix select_related() problems w/Oracle and pagination.
23 22
     def test02_select_related(self):
24 23
         "Testing `select_related` on geographic models (see #7126)."
25 24
         qs1 = City.objects.all()
@@ -34,7 +33,6 @@ def test02_select_related(self):
34 33
                 self.assertEqual(Point(lon, lat), c.location.point)
35 34
 
36 35
     @no_mysql
37  
-    @no_oracle # Pagination problem is implicated in this test as well.
38 36
     def test03_transform_related(self):
39 37
         "Testing the `transform` GeoQuerySet method on related geographic models."
40 38
         # All the transformations are to state plane coordinate systems using

0 notes on commit a488589

Please sign in to comment.
Something went wrong with that request. Please try again.