diff --git a/django/newforms/widgets.py b/django/newforms/widgets.py index 0dd0692e29..996e353775 100644 --- a/django/newforms/widgets.py +++ b/django/newforms/widgets.py @@ -189,6 +189,10 @@ class RadioFieldRenderer(StrAndUnicode): for i, choice in enumerate(self.choices): yield RadioInput(self.name, self.value, self.attrs.copy(), choice, i) + def __getitem__(self, idx): + choice = self.choices[idx] # Let the IndexError propogate + return RadioInput(self.name, self.value, self.attrs.copy(), choice, idx) + def __unicode__(self): "Outputs a