Ticket #16537: 16537.diff

File 16537.diff, 1.4 KB (added by Aymeric Augustin, 13 years ago)
  • django/contrib/gis/utils/layermapping.py

     
    429429        SpatialRefSys = self.spatial_backend.spatial_ref_sys()
    430430        try:
    431431            # Getting the target spatial reference system
    432             target_srs = SpatialRefSys.objects.get(srid=self.geo_field.srid).srs
     432            target_srs = SpatialRefSys.objects.using(self.using).get(srid=self.geo_field.srid).srs
    433433
    434434            # Creating the CoordTransform object
    435435            return CoordTransform(self.source_srs, target_srs)
  • django/contrib/gis/utils/srs.py

     
    6969    try:
    7070        # Try getting via SRID only, because using all kwargs may
    7171        # differ from exact wkt/proj in database.
    72         sr = SpatialRefSys.objects.get(srid=srs.srid)
     72        sr = SpatialRefSys.objects.using(database).get(srid=srs.srid)
    7373    except SpatialRefSys.DoesNotExist:
    74         sr = SpatialRefSys.objects.create(**kwargs)
     74        sr = SpatialRefSys.objects.using(database).create(**kwargs)
    7575
    7676# Alias is for backwards-compatibility purposes.
    7777add_postgis_srs = add_srs_entry
Back to Top