#23307 closed Cleanup/optimization (fixed)
max_num limits total number of forms, not empty forms
Reported by: | velle | Owned by: | Aziz Alsaffar |
---|---|---|---|
Component: | Documentation | Version: | dev |
Severity: | Normal | Keywords: | afraid-to-commit |
Cc: | cmawebsite@… | Triage Stage: | Accepted |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
On: https://docs.djangoproject.com/en/1.6/topics/forms/formsets/
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 by , 10 years ago
comment:2 by , 10 years ago
Cc: | added |
---|
comment:3 by , 10 years ago
Triage Stage: | Unreviewed → Accepted |
---|
comment:4 by , 10 years ago
Keywords: | afraid-to-commit added |
---|---|
Version: | 1.4 → master |
I've marked this ticket as especially suitable for people following the Don't be afraid to commit tutorial at the DjangoCon US 2014 sprints.
If you're tackling this ticket, please don't hesitate to ask me for guidance if you'd like any, either at the sprints themselves, or here or on the Django IRC channels, where I can be found as EvilDMP.
comment:5 by , 10 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
I'm picking this up at the don't be afraid to commit workshop in the djangocon sprints
comment:8 by , 10 years ago
Has patch: | set |
---|
comment:9 by , 10 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
It's true
max_num
limits the total number of forms, but it also allows you (withextra
) to control the number of blank forms, but I agree it's a hair unclear.Re
objects
: mayberows
oritems
? The example at the top simply uses an examplearticle
, even though it's not a model form.Do you a clearer way to word these sentences?