class CustomTableFieldRenderer(forms.widget.RadioFieldRenderer):

    def __iter__(self):
        for i, choice in enumerate(self.choices):
            yield CustomTableRadioInput(self.name, self.value, self.attrs.
                copy(), choice, i)

def __getitem__(self, idx):
    choice = self.choices[idx]
return CustomTableRadioInput(self.name, self.value, self.attrs.copy(),
    choice, idx)
How to get ModelChoiceField instances in the template