diff options
| author | Claude Paroz <claude@2xlibre.net> | 2014-07-16 10:50:35 +0200 |
|---|---|---|
| committer | Claude Paroz <claude@2xlibre.net> | 2014-07-23 12:10:23 +0200 |
| commit | 19d8f2ebf4299b814eb8df472056a0f65fc7b5d7 (patch) | |
| tree | 4abffab06acfa7f35a3cecb1ad83ad835718853d | |
| parent | 731f313d604a6cc141f36d8a1ba9a75790c70154 (diff) | |
Adapted SpatialiteGeometryColumns model to spatialite >= 4
See also:
https://www.gaia-gis.it/fossil/libspatialite/wiki?name=switching-to-4.0
| -rw-r--r-- | django/contrib/gis/db/backends/spatialite/models.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/django/contrib/gis/db/backends/spatialite/models.py b/django/contrib/gis/db/backends/spatialite/models.py index 9e16f0ef1d..78ba9e7696 100644 --- a/django/contrib/gis/db/backends/spatialite/models.py +++ b/django/contrib/gis/db/backends/spatialite/models.py @@ -13,7 +13,10 @@ class SpatialiteGeometryColumns(models.Model): """ f_table_name = models.CharField(max_length=256) f_geometry_column = models.CharField(max_length=256) - type = models.CharField(max_length=30) + if connection.ops.spatial_version[0] >= 4: + type = models.IntegerField(db_column='geometry_type') + else: + type = models.CharField(max_length=30) coord_dimension = models.IntegerField() srid = models.IntegerField(primary_key=True) spatial_index_enabled = models.IntegerField() |
