1
0
mirror of https://github.com/django/django.git synced 2025-11-07 07:15:35 +00:00

Replaced dict() usage with dict literals.

Literals are faster and more idiomatic.
This commit is contained in:
Jon Dufresne
2017-01-23 16:13:49 -08:00
committed by Tim Graham
parent d2e7d15b4c
commit 0d74c41981
4 changed files with 46 additions and 40 deletions

View File

@@ -593,16 +593,16 @@ class ChoiceWidget(Widget):
option_attrs.update(self.checked_attribute)
if 'id' in option_attrs:
option_attrs['id'] = self.id_for_label(option_attrs['id'], index)
return dict(
name=name,
value=value,
label=label,
selected=selected,
index=index,
attrs=option_attrs,
type=self.input_type,
template_name=self.option_template_name,
)
return {
'name': name,
'value': value,
'label': label,
'selected': selected,
'index': index,
'attrs': option_attrs,
'type': self.input_type,
'template_name': self.option_template_name,
}
def get_context(self, name, value, attrs=None):
context = super(ChoiceWidget, self).get_context(name, value, attrs)