Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

add bootstrap to django form

def __init__(self, *args, **kwargs):
    super().__init__(*args, **kwargs)
    for myField in self.fields:
        self.fields[myField].widget.attrs['class'] = 'form-control'
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #add #bootstrap #django #form
ADD COMMENT
Topic
Name
8+4 =