the geometrycolumns and spatialrefsys models for the oracle spatial backend it should be noted that oracle spatial does not have database tables named according to the ogc standard so the closest analogs are used for example the usersdogeommetadata is used for the geometrycolumns model and the sdocoordrefsys is used for the spatialrefsys model todo add support for diminfo column type mdsys sdodimarray return the name of the metadata column used to store the feature table name return the name of the metadata column used to store the feature geometry column optional geometry representing the bounds of this coordinate system by default all are null in the table todo add support for diminfo column type mdsys sdo_dim_array return the name of the metadata column used to store the feature table name return the name of the metadata column used to store the feature geometry column optional geometry representing the bounds of this coordinate system by default all are null in the table
from django.contrib.gis.db import models
from django.contrib.gis.db.backends.base.models import SpatialRefSysMixin


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)
    srid = models.IntegerField(primary_key=True)
    

    class Meta:
        app_label = "gis"
        db_table = "USER_SDO_GEOM_METADATA"
        managed = False

    def __str__(self):
        return "%s - %s (SRID: %s)" % (self.table_name, self.column_name, self.srid)

    @classmethod
    def table_name_col(cls):
        
        return "table_name"

    @classmethod
    def geom_col_name(cls):
        
        return "column_name"


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)
    auth_srid = models.IntegerField()
    auth_name = models.CharField(max_length=256)
    wktext = models.CharField(max_length=2046)
    
    
    cs_bounds = models.PolygonField(null=True)

    class Meta:
        app_label = "gis"
        db_table = "CS_SRS"
        managed = False

    @property
    def wkt(self):
        return self.wktext