django iterate form fields

Django -- Posted on Sept. 12, 2017

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'
                  
   
            

Related Posts