#28039: BaseGeometryWidget.subwidgets() crashes with KeyError 'widget'
---------------------------------+------------------------------------
Reporter: Dariusz Paluch | Owner: nobody
Type: Bug | Status: new
Component: GIS | Version: 1.11
Severity: Release blocker | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
---------------------------------+------------------------------------
Comment (by dpaluch-rp):
Replying to [comment:4 Tim Graham]:
> Dariusz, could you your application with this
[https://github.com/django/django/pull/8343 PR]. I'm not certain that it's
correct.
I'm fixed my application the same way.
```class GoogleMapWidget(forms.BaseGeometryWidget):
map_width = 800
map_height = 500
template_name = 'gis/google.html'
def serialize(self, value):
return value.geojson if value else ''
def get_context(self, name, value, attrs):
# TODO: Bug Django 1.11, BaseGeometryWidget.get_context don't call
super(), so context don't have "widget" key
context = super().get_context(name, value, attrs)
super_context = super(forms.BaseGeometryWidget,
self).get_context(name, value, attrs)
super_context.update(context)
return super_context
```
--
Ticket URL: <https://code.djangoproject.com/ticket/28039#comment:5>
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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/064.80909d0e48362abb10b541e7da3f0c3a%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.