Django 1.6 django.contrib.gis GeometryField crashes on alternate widget
|Reported by:||Owned by:||nobody|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
Description (last modified by )
If I use a TextInput widget to edit a PointField, form validation crashes because the widget doesn't have a
The string representation of a Point using the default srid (4326) doesn't define the SRID, which is unfortunate.
>> p.srid 4326 >> str(p) 'POINT (-122.3996132001327055 37.7942941983347467)' >> p2 = GEOSGeometry('POINT (-122.3996132001327055 37.7942941983347467)') >> p2.srid None
I think the best solution would be to allow the field to transform the value into whatever the default is set as for the field, unless otherwise specified by the widget.
So something like the following PR would be required: