Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

[1.5.x] Fixed geojson detection with Spatialite

This is a partial backport of commit eb9430f. Without this,
geojson support is never detected with Spatialite.
Refs #20252 and #19028.
  • Loading branch information...
commit 9176fa70c1541d29d4d1865770d48b174e5dd968 1 parent 6e3b802
@claudep claudep authored
Showing with 6 additions and 2 deletions.
  1. +6 −2 django/contrib/gis/db/backends/spatialite/operations.py
View
8 django/contrib/gis/db/backends/spatialite/operations.py
@@ -10,6 +10,8 @@
from django.db.backends.sqlite3.base import DatabaseOperations
from django.db.utils import DatabaseError
from django.utils import six
+from django.utils.functional import cached_property
+
class SpatiaLiteOperator(SpatialOperation):
"For SpatiaLite operators (e.g. `&&`, `~`)."
@@ -146,8 +148,10 @@ def confirm_spatial_components_versions(self):
except DatabaseError:
# we are using < 2.4.0-RC4
pass
- if version >= (3, 0, 0):
- self.geojson = 'AsGeoJSON'
+
+ @cached_property
+ def geojson(self):
+ return 'AsGeoJSON' if self.spatialite_version_tuple()[1:] >= (3, 0, 0) else None
def check_aggregate_support(self, aggregate):
"""
Please sign in to comment.
Something went wrong with that request. Please try again.