summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJani Tiainen <jani.tiainen@tintti.net>2015-08-19 21:37:31 +0300
committerTim Graham <timograham@gmail.com>2015-08-19 19:02:30 -0400
commit1b8d7eff3bb1de1f0b51137d720d6fcf7622bced (patch)
tree9443e12afeead1ab86b625682144000703e2f0fd
parentbda408f60bf901620e88d25aad38210985e5c758 (diff)
Refs #12400 -- Added supports_geometry_field_unique_index GIS db feature.
-rw-r--r--django/contrib/gis/db/backends/base/features.py3
-rw-r--r--django/contrib/gis/db/backends/oracle/features.py1
-rw-r--r--tests/gis_tests/geoapp/models.py2
3 files changed, 5 insertions, 1 deletions
diff --git a/django/contrib/gis/db/backends/base/features.py b/django/contrib/gis/db/backends/base/features.py
index 4fd4fd18a7..779ff23689 100644
--- a/django/contrib/gis/db/backends/base/features.py
+++ b/django/contrib/gis/db/backends/base/features.py
@@ -40,6 +40,9 @@ class BaseSpatialFeatures(object):
# Does the database have raster support?
supports_raster = False
+ # Does the database support a unique index on geometry fields?
+ supports_geometry_field_unique_index = True
+
@property
def supports_bbcontains_lookup(self):
return 'bbcontains' in self.connection.ops.gis_operators
diff --git a/django/contrib/gis/db/backends/oracle/features.py b/django/contrib/gis/db/backends/oracle/features.py
index df0aedcf32..b0b7e27df8 100644
--- a/django/contrib/gis/db/backends/oracle/features.py
+++ b/django/contrib/gis/db/backends/oracle/features.py
@@ -6,3 +6,4 @@ from django.db.backends.oracle.features import \
class DatabaseFeatures(BaseSpatialFeatures, OracleDatabaseFeatures):
supports_add_srs_entry = False
supports_geometry_field_introspection = False
+ supports_geometry_field_unique_index = False
diff --git a/tests/gis_tests/geoapp/models.py b/tests/gis_tests/geoapp/models.py
index 664aac9d7b..a819c17ada 100644
--- a/tests/gis_tests/geoapp/models.py
+++ b/tests/gis_tests/geoapp/models.py
@@ -63,7 +63,7 @@ class MultiFields(NamedModel):
class Meta:
unique_together = ('city', 'point')
- required_db_features = ['gis_enabled']
+ required_db_features = ['gis_enabled', 'supports_geometry_field_unique_index']
class Truth(models.Model):