Opened 11 years ago
Last modified 11 years ago
#21496 closed Bug
Django 1.6 django.contrib.gis GeometryField crashes on alternate widget — at Initial Version
Reported by: | Owned by: | nobody | |
---|---|---|---|
Component: | GIS | Version: | 1.6 |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Accepted | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
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:
https://github.com/django/django/pull/1966