#16556: django.contrib.gis.utils.srs fails to preserve database when creating SpatialRefSys querysets -----------------------+----------------------------------- Reporter: anonymous | Owner: chander.ganesan@… Type: Bug | Status: new Milestone: | Component: GIS Version: 1.3 | Severity: Normal Keywords: | Triage Stage: Unreviewed Has patch: 0 | Easy pickings: 0 UI/UX: 0 | -----------------------+----------------------------------- django.contrib.gis.utils.srs fails to preserve database when creating SpatialRefSys querysets
Currently, the code (line ~70 or so) reads like this: # 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) It should read like this: # 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.using(database).get(srid=srs.srid) except SpatialRefSys.DoesNotExist: sr = SpatialRefSys.objects.using(database).create(**kwargs) Otherwise support for multiple backends is sort of broken. -- Ticket URL: <https://code.djangoproject.com/ticket/16556> Django <https://code.djangoproject.com/> The Web framework for perfectionists with deadlines. -- You received this message because you are subscribed to the Google Groups "Django updates" group. To post to this group, send email to django-updates@googlegroups.com. To unsubscribe from this group, send email to django-updates+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-updates?hl=en.