this is an example from formset documentation:

from django import forms>>> class ArticleForm(forms.Form):...     title = 
forms.CharField()...     pub_date = forms.DateField()

from django.forms.formsets import formset_factory

ArticleFormSet = formset_factory(ArticleForm, extra=2)

formset = ArticleFormSet(initial=[...     {'title': u'Django is now open 
source',...      'pub_date': datetime.date.today(),}... ])
>>> for form in formset:...     print(form.as_table())


the above command displays 3 forms in total 1 with initial data and 2 blanks. 
AFTER GOING THROUGH formset.py file I AM NOT ABLE TO UNDERSTAND HOW IS 3 FORMS 
CREATED. How is "for form in formset:" run 3 times?? Please explain this 
functionality in formset.py as to where in the code is it happening?? Thankyou.

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/django-developers?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to