Hi,
I'm trying to upgrade existing application from 1.4 to 1.11.
Below snippet of code to align radio buttons horizontally is working fine with django 1.4
from django.utils.safestring import mark_safe
class HorizontalRadioRenderer(forms.RadioSelect.renderer):
def render(self):
return mark_safe(u'\n'.join([u'%s\n' % w for w in self]))
class ApprovalForm(forms.Form):
approval = forms.ChoiceField(choices=APPROVAL_CHOICES,
initial=0,
widget=forms.RadioSelect(renderer=HorizontalRadioRenderer),
)
But getting below error with django 1.11.
AttributeError: type object 'RadioSelect' has no attribute 'renderer'.
Is it due to introduction of template based widget rendering. Is there any link on how to implement it?
Any help would be appreciated. Thanks!