Skip to content

Instantly share code, notes, and snippets.

@taranjeet
Created June 12, 2018 05:55
Show Gist options
  • Save taranjeet/5b2a5e12a1ba439d106c81d5db035613 to your computer and use it in GitHub Desktop.
Save taranjeet/5b2a5e12a1ba439d106c81d5db035613 to your computer and use it in GitHub Desktop.
Django Library: Book Formset
# 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