Created
December 19, 2016 16:53
-
-
Save dennis90/8adf1010dd63c494f7138f735abd663a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ClientForm(forms.ModelForm): | |
class Meta: | |
model = Client | |
fields = ('name', 'email') | |
def __init__(self, *args, **kwargs): | |
super(ClientForm, self).__init__(*args, **kwargs) | |
for field in iter(self.fields): | |
self.fields[field].widget.attrs.update({'class': 'form-control'}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment