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:15:44 +0200 |
| commit | 86655111c92131df2f32db16e89b7d95d4992646 (patch) | |
| tree | 5d6c91f163d4026301e9fadd9933117b78978bcf | |
| parent | 04030acb85c8fecae7ae3773c9595bb14bdb4547 (diff) | |
[1.7.x] Adapted SpatialiteGeometryColumns model to spatialite >= 4
See also:
https://www.gaia-gis.it/fossil/libspatialite/wiki?name=switching-to-4.0
Backport of 19d8f2ebf4 from master.
| -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() |
