I want to change widget for all BooleanField's in model to Yes/No radio buttons, thought it will be simple:
def __init__(self, *args, **kwargs):
logger.debug("%s -------" % self.__class__.__name__)
super(FormClass,self).__init__(*args,**kwargs)
for field in self.fields:
logger.debug("field of type %s" % type(field))
if type(field) == BooleanField:
logger.debug('YES BOOLEAN')
field.widget = RadioSelect(choices=self.TN_CHOICES)
but it does nothing. In debug log I see every field type is str
. How to determine associated model field type?