mirror of https://github.com/django/django.git
Fixed #19063 -- Fixed version parameter of gml GeoQuerySet method
Thanks lmisek@go2.pl for the report.
This commit is contained in:
parent
c76877c1d2
commit
d25a599dca
|
@ -194,9 +194,9 @@ class GeoQuerySet(QuerySet):
|
||||||
# PostGIS AsGML() aggregate function parameter order depends on the
|
# PostGIS AsGML() aggregate function parameter order depends on the
|
||||||
# version -- uggh.
|
# version -- uggh.
|
||||||
if backend.spatial_version > (1, 3, 1):
|
if backend.spatial_version > (1, 3, 1):
|
||||||
procedure_fmt = '%(version)s,%(geo_col)s,%(precision)s'
|
s['procedure_fmt'] = '%(version)s,%(geo_col)s,%(precision)s'
|
||||||
else:
|
else:
|
||||||
procedure_fmt = '%(geo_col)s,%(precision)s,%(version)s'
|
s['procedure_fmt'] = '%(geo_col)s,%(precision)s,%(version)s'
|
||||||
s['procedure_args'] = {'precision' : precision, 'version' : version}
|
s['procedure_args'] = {'precision' : precision, 'version' : version}
|
||||||
|
|
||||||
return self._spatial_attribute('gml', s, **kwargs)
|
return self._spatial_attribute('gml', s, **kwargs)
|
||||||
|
|
|
@ -529,6 +529,9 @@ class GeoQuerySetTest(TestCase):
|
||||||
for ptown in [ptown1, ptown2]:
|
for ptown in [ptown1, ptown2]:
|
||||||
self.assertTrue(gml_regex.match(ptown.gml))
|
self.assertTrue(gml_regex.match(ptown.gml))
|
||||||
|
|
||||||
|
if postgis:
|
||||||
|
self.assertIn('<gml:pos srsDimension="2">', City.objects.gml(version=3).get(name='Pueblo').gml)
|
||||||
|
|
||||||
def test_kml(self):
|
def test_kml(self):
|
||||||
"Testing KML output from the database using GeoQuerySet.kml()."
|
"Testing KML output from the database using GeoQuerySet.kml()."
|
||||||
# Only PostGIS and Spatialite (>=2.4.0-RC4) support KML serialization
|
# Only PostGIS and Spatialite (>=2.4.0-RC4) support KML serialization
|
||||||
|
|
Loading…
Reference in New Issue