I worked on this for several hours, trying to find a way to use my own renderer on RadioSelect, but there is no way to pass the selection number. Instead, I went for kludgey, but a simple approach. Added __init__ function to my form:
def __init__(self, *args, **kwargs): super(FormName, self).__init__(*args, **kwargs) self.radiofield_choice = re.findall(r'<li>(.+?)</li>', unicode(self['radiofield_name']))
Uses the default rendering of RadioSelect to create a widget, and then parses the individual HTML code. You can even combine this with certain options to create a dictionary instead of a list.
In my template, I used {{ form.radiofield_choice.0|safe }} to render only the first element. Increase zero to get other items.
If for some reason you need only input fields without adding labels, use r'(<input.+/>)' .
source share