1 2 3 4 5 6 7 8 9 10 11 12 | from django.forms.widgets import RadioSelect
class HorizRadioRenderer(RadioSelect.renderer):
""" this overrides widget method to put radio buttons horizontally
instead of vertically.
"""
def render(self):
"""Outputs radios"""
return mark_safe(u'\n'.join([u'%s\n' % w for w in self]))
class HorizRadioSelect(RadioSelect):
renderer = HorizRadioRenderer
|
More like this
- Rendering radio-buttons with icons instead of labels by jeverling 3 years, 2 months ago
- RadioSelectWithHelpText by moxypark 2 years, 9 months ago
- CheckboxMultiSelect with interable checkboxes by pyramids16 6 months, 3 weeks ago
- Allow editing of the selected object of the filter_vertical/filter_horizontal widget with jquery by jpic 4 years, 7 months ago
- Choice Submit Widget by fredbird 1 year, 6 months ago
Comments