summaryrefslogtreecommitdiff
path: root/django/forms/widgets.py
diff options
context:
space:
mode:
authorTMFGravyHands <cthatcher@fool.com>2015-06-11 07:52:03 -0400
committerTim Graham <timograham@gmail.com>2015-06-11 10:15:52 -0400
commit339c01fb7552feb8df125ef7e5420dae04fd913f (patch)
tree3b10bc523af21798c107f015fba6bf0247ebd88b /django/forms/widgets.py
parentafa82aa41a8cd596163990c311c698d25660cccc (diff)
Allowed easier extendability of ChoiceFieldRenderer.
Diffstat (limited to 'django/forms/widgets.py')
-rw-r--r--django/forms/widgets.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/django/forms/widgets.py b/django/forms/widgets.py
index cc82c2ec79..896984dc08 100644
--- a/django/forms/widgets.py
+++ b/django/forms/widgets.py
@@ -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()))