summaryrefslogtreecommitdiff
path: root/django
diff options
context:
space:
mode:
Diffstat (limited to 'django')
-rw-r--r--django/contrib/gis/forms/widgets.py19
1 files changed, 10 insertions, 9 deletions
diff --git a/django/contrib/gis/forms/widgets.py b/django/contrib/gis/forms/widgets.py
index 82d9f26b1c..df5cd9b3f0 100644
--- a/django/contrib/gis/forms/widgets.py
+++ b/django/contrib/gis/forms/widgets.py
@@ -63,15 +63,16 @@ class BaseGeometryWidget(Widget):
if attrs is None:
attrs = {}
- context.update(self.build_attrs(self.attrs, dict(
- name=name,
- module='geodjango_%s' % name.replace('-', '_'), # JS-safe
- serialized=self.serialize(value),
- geom_type=gdal.OGRGeomType(self.attrs['geom_type']),
- STATIC_URL=settings.STATIC_URL,
- LANGUAGE_BIDI=translation.get_language_bidi(),
- **attrs
- )))
+ build_attrs_kwargs = {
+ 'name': name,
+ 'module': 'geodjango_%s' % name.replace('-', '_'), # JS-safe
+ 'serialized': self.serialize(value),
+ 'geom_type': gdal.OGRGeomType(self.attrs['geom_type']),
+ 'STATIC_URL': settings.STATIC_URL,
+ 'LANGUAGE_BIDI': translation.get_language_bidi(),
+ }
+ build_attrs_kwargs.update(attrs)
+ context.update(self.build_attrs(self.attrs, build_attrs_kwargs))
return context