Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed #19063 -- Fixed version parameter of gml GeoQuerySet method

Thanks lmisek@go2.pl for the report.
  • Loading branch information...
commit d25a599dca9b7644b238f6c89a66545dfdabe393 1 parent c76877c
Claude Paroz authored October 03, 2012
4  django/contrib/gis/db/models/query.py
@@ -194,9 +194,9 @@ def gml(self, precision=8, version=2, **kwargs):
194 194
             # PostGIS AsGML() aggregate function parameter order depends on the
195 195
             # version -- uggh.
196 196
             if backend.spatial_version > (1, 3, 1):
197  
-                procedure_fmt = '%(version)s,%(geo_col)s,%(precision)s'
  197
+                s['procedure_fmt'] = '%(version)s,%(geo_col)s,%(precision)s'
198 198
             else:
199  
-                procedure_fmt = '%(geo_col)s,%(precision)s,%(version)s'
  199
+                s['procedure_fmt'] = '%(geo_col)s,%(precision)s,%(version)s'
200 200
             s['procedure_args'] = {'precision' : precision, 'version' : version}
201 201
 
202 202
         return self._spatial_attribute('gml', s, **kwargs)
3  django/contrib/gis/tests/geoapp/tests.py
@@ -529,6 +529,9 @@ def test_gml(self):
529 529
         for ptown in [ptown1, ptown2]:
530 530
             self.assertTrue(gml_regex.match(ptown.gml))
531 531
 
  532
+        if postgis:
  533
+            self.assertIn('<gml:pos srsDimension="2">', City.objects.gml(version=3).get(name='Pueblo').gml)
  534
+
532 535
     def test_kml(self):
533 536
         "Testing KML output from the database using GeoQuerySet.kml()."
534 537
         # Only PostGIS and Spatialite (>=2.4.0-RC4) support KML serialization

0 notes on commit d25a599

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