Ticket #21003: patch-widget-srid.patch

File patch-widget-srid.patch, 648 bytes (added by Mathieu Leplatre, 11 years ago)

Fix if widget srid != field srid

  • django/contrib/gis/forms/fields.py

    diff --git a/django/contrib/gis/forms/fields.py b/django/contrib/gis/forms/fields.py
    index 59e7259..00d66a9 100644
    a b class GeometryField(forms.Field):  
    9292
    9393        # Only do a geographic comparison if both values are available
    9494        if initial and data:
    95             data = fromstr(data)
     95            data = fromstr(data, srid=self.widget.map_srid)
    9696            data.transform(initial.srid)
    9797            # If the initial value was not added by the browser, the geometry
    9898            # provided may be slightly different, the first time it is saved.
Back to Top