Allowed easier extendability of ChoiceFieldRenderer.

This commit is contained in:
TMFGravyHands 2015-06-11 07:52:03 -04:00 committed by Tim Graham
parent afa82aa41a
commit 339c01fb75
1 changed files with 6 additions and 4 deletions

View File

@ -714,10 +714,12 @@ class ChoiceFieldRenderer(object):
attrs_plus = self.attrs.copy()
if id_:
attrs_plus['id'] += '_{}'.format(i)
sub_ul_renderer = ChoiceFieldRenderer(name=self.name,
value=self.value,
attrs=attrs_plus,
choices=choice_label)
sub_ul_renderer = self.__class__(
name=self.name,
value=self.value,
attrs=attrs_plus,
choices=choice_label,
)
sub_ul_renderer.choice_input_class = self.choice_input_class
output.append(format_html(self.inner_html, choice_value=choice_value,
sub_widgets=sub_ul_renderer.render()))