=== modified file 'django/newforms/widgets.py'
|
|
|
|
| 250 | 250 | "Returns a RadioFieldRenderer instance rather than a Unicode string." |
| 251 | 251 | if value is None: value = '' |
| 252 | 252 | str_value = smart_unicode(value) # Normalize to string. |
| 253 | | attrs = attrs or {} |
| 254 | | return RadioFieldRenderer(name, str_value, attrs, list(chain(self.choices, choices))) |
| | 253 | final_attrs = self.build_attrs(attrs) |
| | 254 | return RadioFieldRenderer(name, str_value, final_attrs, list(chain(self.choices, choices))) |
| 255 | 255 | |
| 256 | 256 | def id_for_label(self, id_): |
| 257 | 257 | # RadioSelect is represented by multiple <input type="radio"> fields, |
| … |
… |
|
| 312 | 312 | super(MultiWidget, self).__init__(attrs) |
| 313 | 313 | |
| 314 | 314 | def render(self, name, value, attrs=None): |
| | 315 | final_attrs = self.build_attrs(attrs) |
| 315 | 316 | # value is a list of values, each corresponding to a widget |
| 316 | 317 | # in self.widgets. |
| 317 | 318 | if not isinstance(value, list): |
| … |
… |
|
| 322 | 323 | widget_value = value[i] |
| 323 | 324 | except KeyError: |
| 324 | 325 | widget_value = None |
| 325 | | output.append(widget.render(name + '_%s' % i, widget_value, attrs)) |
| | 326 | output.append(widget.render(name + '_%s' % i, widget_value, final_attrs)) |
| 326 | 327 | return self.format_output(output) |
| 327 | 328 | |
| 328 | 329 | def value_from_datadict(self, data, name): |