Created
June 12, 2018 06:00
-
-
Save taranjeet/20dbf7c56c250ca0acc54f576dc7eee6 to your computer and use it in GitHub Desktop.
Django Library: Book Model Formset
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
# forms.py :: part 1 | |
from django.forms import modelformset_factory | |
BookModelFormset = modelformset_factory( | |
Book, | |
fields=('name', ), | |
extra=1, | |
widgets={'name': forms.TextInput(attrs={ | |
'class': 'form-control', | |
'placeholder': 'Enter Book Name here' | |
}) | |
} | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment