django iterate form fields
class FormMixin(object):
def __init__(self, *args, **kwargs):
super(FormMixin, self).__init__(*args, **kwargs)
for field in self.fields:
self.fields[field].widget.attrs['class'] = 'form-control'