Created
June 12, 2018 05:55
-
-
Save taranjeet/5b2a5e12a1ba439d106c81d5db035613 to your computer and use it in GitHub Desktop.
Django Library: Book 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 import forms | |
from django.forms import formset_factory | |
class BookForm(forms.Form): | |
name = forms.CharField( | |
label='Book Name', | |
widget=forms.TextInput(attrs={ | |
'class': 'form-control', | |
'placeholder': 'Enter Book Name here' | |
}) | |
) | |
BookFormset = formset_factory(BookForm, extra=1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment