#21003: BaseGeometryWidget is not idempotent -------------------------------------+------------------------------------- Reporter: leplatrem | Owner: nobody Type: | Status: new Cleanup/optimization | Version: Component: GIS | 1.6-beta-1 Severity: Normal | Resolution: Keywords: | Triage Stage: Accepted Has patch: 0 | Needs documentation: 0 Needs tests: 0 | Patch needs improvement: 0 Easy pickings: 1 | UI/UX: 0 -------------------------------------+------------------------------------- Changes (by claudep):
* needs_better_patch: => 0 * needs_docs: => 0 * needs_tests: => 0 * stage: Unreviewed => Accepted Comment: What about: {{{ diff --git a/django/contrib/gis/forms/fields.py b/django/contrib/gis/forms/fields.py index 2fb8b54..04a19fd 100644 --- a/django/contrib/gis/forms/fields.py +++ b/django/contrib/gis/forms/fields.py @@ -87,6 +87,8 @@ class GeometryField(forms.Field): # Only do a geographic comparison if both values are available if initial and data: data = fromstr(data) + if not data.srid and self.srid: + data.srid = self.srid data.transform(initial.srid) # If the initial value was not added by the browser, the geometry # provided may be slightly different, the first time it is saved. }}} -- Ticket URL: <https://code.djangoproject.com/ticket/21003#comment:1> 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 unsubscribe from this group and stop receiving emails from it, send an email to django-updates+unsubscr...@googlegroups.com. To post to this group, send email to django-updates@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/067.d966172f34f4bee874b8c339ab2f12bd%40djangoproject.com. For more options, visit https://groups.google.com/groups/opt_out.