max_num limits total number of forms, not empty forms
|Reported by:||velle||Owned by:||Octowl|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
The documentation says: "The max_num parameter to formset_factory() gives you the ability to limit the maximum number of empty forms the formset will display".
I believe max_num limits the total number of forms, not the empty forms, or else the rest of the documentation on the page and the example do not make sense.
Also, right after the example they write: "If the value of max_num is greater than the number of existing objects, up to extra additional blank forms will be added to the formset, so long as the total number of forms does not exceed max_num."
They mention "objects". But if a newcomer to Django is reading the documentation on forms from one end to the other, he will not know what is meant by objects, when he hasnt yet read about ModelForms. I don't know how to deal with this. Maybe the ModelForm section could come before FormSet, but I have not thought that through.
Change History (11)
comment:1 Changed 16 months ago by collinanderson
- Needs documentation unset
- Needs tests unset
- Patch needs improvement unset
comment:4 Changed 15 months ago by evildmp
- Keywords afraid-to-commit added
- Version changed from 1.4 to master
comment:5 Changed 15 months ago by Octowl
- Owner changed from nobody to Octowl
- Status changed from new to assigned
comment:9 Changed 15 months ago by Tim Graham <timograham@…>
- Resolution set to fixed
- Status changed from assigned to closed