Permalink
Browse files

Adapted SpatialiteGeometryColumns model to spatialite >= 4

  • Loading branch information...
claudep committed Jul 16, 2014
1 parent 731f313 commit 19d8f2ebf4299b814eb8df472056a0f65fc7b5d7
Showing with 4 additions and 1 deletion.
  1. +4 −1 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()

0 comments on commit 19d8f2e

Please sign in to comment.