Formsets: Misleading documentation
|Reported by:||Andreas||Owned by:||nobody|
|Cc:||Triage Stage:||Ready for checkin|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
The example of the documentation at <http://docs.djangoproject.com/en/dev/topics/forms/formsets/#using-initial-data-with-a-formset> is maybe not optimal to explain how the 'extra' and 'initial' parameters of a formset work together. It looks like the total number of forms is always extra + 1 (in fact, 'extra' somehow suggests the additional number of forms with respect to a standard, single form). Then, it looks like these forms are filled with the content of the dicts in the initial_list.
Even though the correct behaviour is described in the text, this is easily overread, since usually the examples are the best documentation ;-)
If you'd provide in the example for example 'extra=1' and then pass a list with two dicts as 'initial', I think the behaviour would be more obvious.
We were just struggling over an hour until we got it.
Change History (6)
comment:1 Changed 5 years ago by timo
- Needs documentation unset
- Needs tests unset
- Patch needs improvement unset