      if SpatialBackend.postgis: kwargs['srtext'] = srs.wkt
      if SpatialBackend.spatialite: kwargs['ref_sys_name'] = ref_sys_name or srs.name
  
      # Creating the spatial_ref_sys model.
      sr, created = SpatialRefSys.objects.get_or_create(**kwargs)
 
</s> remove     # Backend-specific keyword settings.
    if SpatialBackend.postgis: kwargs['srtext'] = srs.wkt
    if SpatialBackend.spatialite: kwargs['ref_sys_name'] = ref_sys_name or srs.name
 </s> add     # Backend-specific fields for the SpatialRefSys model.
    if connection.ops.postgis:
        kwargs['srtext'] = srs.wkt
    if connection.ops.spatialite:
        kwargs['ref_sys_name'] = ref_sys_name or srs.name </s> remove     if SpatialBackend.oracle or SpatialBackend.mysql:
        raise Exception('This utility not supported on Oracle or MySQL spatial backends.')
 </s> add      database:
      The name of the database connection to use; the default is the value
      of `django.db.DEFAULT_DB_ALIAS` (at the time of this writing, it's value
      is 'default').
    """
    connection = connections[database]
    if not hasattr(connection.ops, 'spatial_version'):
        raise Exception('The `add_srs_entry` utility only works '
                        'with spatial backends.')
    if connection.ops.oracle or connection.ops.mysql:
        raise Exception('This utility does not support the '
                        'Oracle or MySQL spatial backends.')
    SpatialRefSys = connection.ops.spatial_ref_sys() </s> remove         raise Exception('Spatial reference requires an SRID to be compatible with PostGIS.')
 </s> add         raise Exception('Spatial reference requires an SRID to be '
                        'compatible with the spatial backend.') </s> remove     # Initializing the keyword arguments dictionary for both PostGIS and SpatiaLite.
 </s> add     # Initializing the keyword arguments dictionary for both PostGIS
    # and SpatiaLite.
    try:
        # Try getting via SRID only, because using all kwargs may
        # differ from exact wkt/proj in database.
        sr = SpatialRefSys.objects.get(srid=srs.srid)
    except SpatialRefSys.DoesNotExist:
        sr = SpatialRefSys.objects.create(**kwargs)

# Alias is for backwards-compatibility purposes.
add_postgis_srs = add_srs_entry
      if SpatialBackend.postgis: kwargs['srtext'] = srs.wkt
      if SpatialBackend.spatialite: kwargs['ref_sys_name'] = ref_sys_name or srs.name
  
      # Creating the spatial_ref_sys model.
    try:
        # Try getting via SRID only, because using all kwargs may
        # differ from exact wkt/proj in database.
        sr = SpatialRefSys.objects.get(srid=srs.srid)
    except SpatialRefSys.DoesNotExist:
        sr = SpatialRefSys.objects.create(**kwargs)

# Alias is for backwards-compatibility purposes.
add_postgis_srs = add_srs_entry
keep keep keep keep replace
 Fixed #12591 -- Renamed `add_postgis_srs` to `add_srs_entry` (keeping backwards-compatible alias), added `database` keyword for multi-db, removed deprecated `SpatialBackend` references; no longer use `get_or_create` and look for existing entry based on SRID value. 


git-svn-id: http://code.djangoproject.com/svn/django/trunk@12228 bcc190cf-cafb-0310-a4f2-bffc1f526a37 
django/contrib/gis/utils/srs.py