Dimitris Kougioumtzis Blog About technology

django iterate form fields

Category Django

Posted on Sept. 12, 2017



django iterate form fields


1
2
3
4
5
6
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'

About

My name is Dimitris Kougioumtzis and i work as a Web developer at Rapidbounce Company

Elsewhere