mirror of
https://github.com/django/django.git
synced 2025-06-05 03:29:12 +00:00
[1.5.x] Fixed geojson detection with Spatialite
This is a partial backport of commit eb9430fc4be1. Without this, geojson support is never detected with Spatialite. Refs #20252 and #19028.
This commit is contained in:
parent
6e3b80239e
commit
9176fa70c1
@ -10,6 +10,8 @@ from django.core.exceptions import ImproperlyConfigured
|
|||||||
from django.db.backends.sqlite3.base import DatabaseOperations
|
from django.db.backends.sqlite3.base import DatabaseOperations
|
||||||
from django.db.utils import DatabaseError
|
from django.db.utils import DatabaseError
|
||||||
from django.utils import six
|
from django.utils import six
|
||||||
|
from django.utils.functional import cached_property
|
||||||
|
|
||||||
|
|
||||||
class SpatiaLiteOperator(SpatialOperation):
|
class SpatiaLiteOperator(SpatialOperation):
|
||||||
"For SpatiaLite operators (e.g. `&&`, `~`)."
|
"For SpatiaLite operators (e.g. `&&`, `~`)."
|
||||||
@ -146,8 +148,10 @@ class SpatiaLiteOperations(DatabaseOperations, BaseSpatialOperations):
|
|||||||
except DatabaseError:
|
except DatabaseError:
|
||||||
# we are using < 2.4.0-RC4
|
# we are using < 2.4.0-RC4
|
||||||
pass
|
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):
|
def check_aggregate_support(self, aggregate):
|
||||||
"""
|
"""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user