diff options
| author | Claude Paroz <claude@2xlibre.net> | 2012-12-26 12:45:41 +0100 |
|---|---|---|
| committer | Claude Paroz <claude@2xlibre.net> | 2012-12-26 12:45:41 +0100 |
| commit | 0907d3c6f511ef3dc68d381389a32b9b54ae4be7 (patch) | |
| tree | 5e8602437f98c84a1ae4cf30edf4104273c50103 | |
| parent | 9c5a6adf3341c59efee4ca6d0037f8069185e0e3 (diff) | |
Fixed #16408 -- Re-fixed value conversion with Spatialite backend
| -rw-r--r-- | django/contrib/gis/db/models/sql/query.py | 2 | ||||
| -rw-r--r-- | django/contrib/gis/tests/geoapp/test_regress.py | 3 |
2 files changed, 4 insertions, 1 deletions
diff --git a/django/contrib/gis/db/models/sql/query.py b/django/contrib/gis/db/models/sql/query.py index 3b8245e879..5877f2975a 100644 --- a/django/contrib/gis/db/models/sql/query.py +++ b/django/contrib/gis/db/models/sql/query.py @@ -72,6 +72,8 @@ class GeoQuery(sql.Query): value = Area(**{field.area_att : value}) elif isinstance(field, (GeomField, GeometryField)) and value: value = Geometry(value) + elif field is not None: + return super(GeoQuery, self).convert_values(value, field, connection) return value def get_aggregation(self, using): diff --git a/django/contrib/gis/tests/geoapp/test_regress.py b/django/contrib/gis/tests/geoapp/test_regress.py index 0e9c5c44a3..15e8555741 100644 --- a/django/contrib/gis/tests/geoapp/test_regress.py +++ b/django/contrib/gis/tests/geoapp/test_regress.py @@ -5,7 +5,7 @@ from datetime import datetime from django.contrib.gis.tests.utils import no_mysql, no_spatialite from django.contrib.gis.shortcuts import render_to_kmz -from django.db.models import Count +from django.db.models import Count, Min from django.test import TestCase from .models import City, PennsylvaniaCity, State, Truth @@ -50,6 +50,7 @@ class GeoRegressionTests(TestCase): mansfield = PennsylvaniaCity.objects.create(name='Mansfield', county='Tioga', point='POINT(-77.071445 41.823881)', founded=founded) self.assertEqual(founded, PennsylvaniaCity.objects.dates('founded', 'day')[0]) + self.assertEqual(founded, PennsylvaniaCity.objects.aggregate(Min('founded'))['founded__min']) def test_empty_count(self): "Testing that PostGISAdapter.__eq__ does check empty strings. See #13670." |
