Skip to content

Commit

Permalink
[1.5.x] Fixed geojson detection with Spatialite
Browse files Browse the repository at this point in the history
This is a partial backport of commit eb9430f. Without this,
geojson support is never detected with Spatialite.
Refs #20252 and #19028.
  • Loading branch information
claudep committed Apr 14, 2013
1 parent 6e3b802 commit 9176fa7
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions django/contrib/gis/db/backends/spatialite/operations.py
Expand Up @@ -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. `&&`, `~`)."
Expand Down Expand Up @@ -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):
"""
Expand Down

0 comments on commit 9176fa7

Please sign in to comment.