1
0
mirror of https://github.com/django/django.git synced 2025-10-31 09:41:08 +00:00

Gave unique names to SpatialRefSysModels.

Prevented clashes in the app registry.

Fixed #22790. Thanks timo for the report.
This commit is contained in:
Aymeric Augustin
2014-06-08 09:54:35 +02:00
parent d8f6b55aa8
commit 6e5651e514
8 changed files with 25 additions and 21 deletions

View File

@@ -13,7 +13,7 @@ from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class GeometryColumns(models.Model):
class OracleGeometryColumns(models.Model):
"Maps to the Oracle USER_SDO_GEOM_METADATA table."
table_name = models.CharField(max_length=32)
column_name = models.CharField(max_length=1024)
@@ -21,6 +21,7 @@ class GeometryColumns(models.Model):
# TODO: Add support for `diminfo` column (type MDSYS.SDO_DIM_ARRAY).
class Meta:
app_label = 'gis'
db_table = 'USER_SDO_GEOM_METADATA'
managed = False
@@ -44,7 +45,7 @@ class GeometryColumns(models.Model):
return '%s - %s (SRID: %s)' % (self.table_name, self.column_name, self.srid)
class SpatialRefSys(models.Model, SpatialRefSysMixin):
class OracleSpatialRefSys(models.Model, SpatialRefSysMixin):
"Maps to the Oracle MDSYS.CS_SRS table."
cs_name = models.CharField(max_length=68)
srid = models.IntegerField(primary_key=True)
@@ -57,6 +58,7 @@ class SpatialRefSys(models.Model, SpatialRefSysMixin):
objects = models.GeoManager()
class Meta:
app_label = 'gis'
db_table = 'CS_SRS'
managed = False

View File

@@ -289,12 +289,12 @@ class OracleOperations(DatabaseOperations, BaseSpatialOperations):
# Routines for getting the OGC-compliant models.
def geometry_columns(self):
from django.contrib.gis.db.backends.oracle.models import GeometryColumns
return GeometryColumns
from django.contrib.gis.db.backends.oracle.models import OracleGeometryColumns
return OracleGeometryColumns
def spatial_ref_sys(self):
from django.contrib.gis.db.backends.oracle.models import SpatialRefSys
return SpatialRefSys
from django.contrib.gis.db.backends.oracle.models import OracleSpatialRefSys
return OracleSpatialRefSys
def modify_insert_params(self, placeholders, params):
"""Drop out insert parameters for NULL placeholder. Needed for Oracle Spatial