Ticket #16537: 16537.diff
File 16537.diff, 1.4 KB (added by , 13 years ago) |
---|
-
django/contrib/gis/utils/layermapping.py
429 429 SpatialRefSys = self.spatial_backend.spatial_ref_sys() 430 430 try: 431 431 # Getting the target spatial reference system 432 target_srs = SpatialRefSys.objects. get(srid=self.geo_field.srid).srs432 target_srs = SpatialRefSys.objects.using(self.using).get(srid=self.geo_field.srid).srs 433 433 434 434 # Creating the CoordTransform object 435 435 return CoordTransform(self.source_srs, target_srs) -
django/contrib/gis/utils/srs.py
69 69 try: 70 70 # Try getting via SRID only, because using all kwargs may 71 71 # 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) 73 73 except SpatialRefSys.DoesNotExist: 74 sr = SpatialRefSys.objects. create(**kwargs)74 sr = SpatialRefSys.objects.using(database).create(**kwargs) 75 75 76 76 # Alias is for backwards-compatibility purposes. 77 77 add_postgis_srs = add_srs_entry