Commit 402f8ced authored by Justin Bronn's avatar Justin Bronn
Browse files

Fixed #13315, #13430 -- Recreated `django.contrib.gis.db.backend` module with...

Fixed #13315, #13430 -- Recreated `django.contrib.gis.db.backend` module with `SpatialBackend` alias and added `Adaptor` alias for backwards-compatibility purposes; added GeoDjango 1.2 backwards-incompatibility documentation and release notes; added a section in the docs about how MySQL is a crippled spatial database; updated versions in install docs.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@13097 bcc190cf-cafb-0310-a4f2-bffc1f526a37
parent 41ccfa15
Loading
Loading
Loading
Loading
+24 −0
Original line number Diff line number Diff line
from django.db import connection

if hasattr(connection.ops, 'spatial_version'):
    from warnings import warn
    warn('The `django.contrib.gis.db.backend` module was refactored and '
         'renamed to `django.contrib.gis.db.backends` in 1.2.  '
         'All functionality of `SpatialBackend` '
         'has been moved to the `ops` attribute of the spatial database '
         'backend.  A `SpatialBackend` alias is provided here for '
         'backwards-compatibility, but will be removed in 1.3.')
    SpatialBackend = connection.ops

from django.db import connection

if hasattr(connection.ops, 'spatial_version'):
    from warnings import warn
    warn('The `django.contrib.gis.db.backend` module was refactored and '
         'renamed to `django.contrib.gis.db.backends` in 1.2.  '
         'All functionality of `SpatialBackend` '
         'has been moved to the `ops` attribute of the spatial database '
         'backend.  A `SpatialBackend` alias is provided here for '
         'backwards-compatibility, but will be removed in 1.3.')
    SpatialBackend = connection.ops
+1 −0
Original line number Diff line number Diff line
@@ -13,6 +13,7 @@ class MySQLOperations(DatabaseOperations, BaseSpatialOperations):
    from_text = 'GeomFromText'

    Adapter = WKTAdapter
    Adaptor = Adapter # Backwards-compatibility alias.

    geometry_functions = {
        'bbcontains' : 'MBRContains', # For consistency w/PostGIS API
+0 −2
Original line number Diff line number Diff line
@@ -18,7 +18,6 @@ class GeometryColumns(models.Model):
    srid = models.IntegerField(primary_key=True)
    # TODO: Add support for `diminfo` column (type MDSYS.SDO_DIM_ARRAY).
    class Meta:
        app_label = 'gis'
        db_table = 'USER_SDO_GEOM_METADATA'
        managed = False

@@ -54,7 +53,6 @@ class SpatialRefSys(models.Model, SpatialRefSysMixin):
    objects = models.GeoManager()

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

+1 −0
Original line number Diff line number Diff line
@@ -75,6 +75,7 @@ class OracleOperations(DatabaseOperations, BaseSpatialOperations):
    valid_aggregates = dict([(a, None) for a in ('Union', 'Extent')])

    Adapter = OracleSpatialAdapter
    Adaptor = Adapter # Backwards-compatibility alias.

    area = 'SDO_GEOM.SDO_AREA'
    gml= 'SDO_UTIL.TO_GMLGEOMETRY'
+0 −2
Original line number Diff line number Diff line
@@ -18,7 +18,6 @@ class GeometryColumns(models.Model):
    type = models.CharField(max_length=30)

    class Meta:
        app_label = 'gis'
        db_table = 'geometry_columns'
        managed = False

@@ -55,7 +54,6 @@ class SpatialRefSys(models.Model, SpatialRefSysMixin):
    proj4text = models.CharField(max_length=2048)

    class Meta:
        app_label = 'gis'
        db_table = 'spatial_ref_sys'
        managed = False

Loading