Last active
January 10, 2018 17:19
-
-
Save hancush/72261ec42bf29054350261917b26b381 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
from make_a_formset import formset | |
# populate your formset | |
for form in formset: | |
form_data = form.clean_data | |
# {'name': 'Hannah', 'favorite_color': 'yellow'} | |
# do stuff with the data |
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
from django import forms | |
from django.forms import formset_factory | |
# Make your form | |
class PersonForm(forms.Form): | |
name = forms.CharField() | |
favorite_color = forms.CharField() | |
# Make your formset factory | |
PeopleFormSet = formset_factory(PersonForm) | |
# Instantate your formset | |
formset = PeopleFormSet() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment