Django 1.6 django.contrib.gis GeometryField crashes on alternate widget
|Reported by:||rhettg@…||Owned by:||nobody|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
Description (last modified by claudep)
If I use a TextInput widget to edit a PointField, form validation crashes because the widget doesn't have a map_srid.
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:
Change History (6)
comment:1 Changed 22 months ago by claudep
- Description modified (diff)
- Needs documentation unset
- Needs tests unset
- Patch needs improvement unset
- Triage Stage changed from Unreviewed to Accepted
comment:5 Changed 21 months ago by Claude Paroz <claude@…>
- Resolution set to fixed
- Status changed from new to closed