[Django] #23307: max_num limits total number of forms, not empty forms

34 views
Skip to first unread message

Django

unread,
Aug 17, 2014, 5:19:05 PM8/17/14
to django-...@googlegroups.com
#23307: max_num limits total number of forms, not empty forms
--------------------------------------+--------------------
Reporter: velle | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Documentation | Version: 1.4
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------------+--------------------
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.

--
Ticket URL: <https://code.djangoproject.com/ticket/23307>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Aug 17, 2014, 9:16:56 PM8/17/14
to django-...@googlegroups.com
#23307: max_num limits total number of forms, not empty forms
-------------------------------------+-------------------------------------
Reporter: velle | Owner: nobody
Type: | Status: new
Cleanup/optimization | Version: 1.4
Component: Documentation | Resolution:
Severity: Normal | Triage Stage:
Keywords: | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by collinanderson):

* needs_better_patch: => 0
* needs_tests: => 0
* needs_docs: => 0


Comment:

It's true `max_num` limits the total number of forms, but it also allows
you (with `extra`) to control the number of blank forms, but I agree it's
a hair unclear.

Re `objects`: maybe `rows` or `items`? The example at the top simply uses
an example `article`, even though it's not a model form.

Do you a clearer way to word these sentences?

--
Ticket URL: <https://code.djangoproject.com/ticket/23307#comment:1>

Django

unread,
Aug 17, 2014, 9:17:24 PM8/17/14
to django-...@googlegroups.com
#23307: max_num limits total number of forms, not empty forms
-------------------------------------+-------------------------------------
Reporter: velle | Owner: nobody

Type: | Status: new
Cleanup/optimization | Version: 1.4
Component: Documentation | Resolution:
Severity: Normal | Triage Stage:
Keywords: | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by collinanderson):

* cc: cmawebsite@… (added)


--
Ticket URL: <https://code.djangoproject.com/ticket/23307#comment:2>

Django

unread,
Aug 19, 2014, 2:25:21 AM8/19/14
to django-...@googlegroups.com
#23307: max_num limits total number of forms, not empty forms
--------------------------------------+------------------------------------

Reporter: velle | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Documentation | Version: 1.4
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by freakboy3742):

* stage: Unreviewed => Accepted


--
Ticket URL: <https://code.djangoproject.com/ticket/23307#comment:3>

Django

unread,
Sep 3, 2014, 4:48:53 PM9/3/14
to django-...@googlegroups.com
#23307: max_num limits total number of forms, not empty forms
--------------------------------------+------------------------------------

Reporter: velle | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Documentation | Version: master
Severity: Normal | Resolution:
Keywords: afraid-to-commit | Triage Stage: Accepted

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by evildmp):

* keywords: => afraid-to-commit
* version: 1.4 => master


Comment:

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''.

--
Ticket URL: <https://code.djangoproject.com/ticket/23307#comment:4>

Django

unread,
Sep 5, 2014, 7:09:50 PM9/5/14
to django-...@googlegroups.com
#23307: max_num limits total number of forms, not empty forms
--------------------------------------+------------------------------------
Reporter: velle | Owner: Octowl
Type: Cleanup/optimization | Status: assigned

Component: Documentation | Version: master
Severity: Normal | Resolution:
Keywords: afraid-to-commit | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by Octowl):

* owner: nobody => Octowl
* status: new => assigned


Comment:

I'm picking this up at the don't be afraid to commit workshop in the
djangocon sprints

--
Ticket URL: <https://code.djangoproject.com/ticket/23307#comment:5>

Django

unread,
Sep 6, 2014, 5:29:44 PM9/6/14
to django-...@googlegroups.com
#23307: max_num limits total number of forms, not empty forms
--------------------------------------+------------------------------------
Reporter: velle | Owner: Octowl
Type: Cleanup/optimization | Status: assigned
Component: Documentation | Version: master
Severity: Normal | Resolution:
Keywords: afraid-to-commit | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------

Comment (by Octowl):

I am making changes in the following branch:

https://github.com/Octowl/django/tree/ticket_23307

--
Ticket URL: <https://code.djangoproject.com/ticket/23307#comment:6>

Django

unread,
Sep 6, 2014, 5:39:14 PM9/6/14
to django-...@googlegroups.com
#23307: max_num limits total number of forms, not empty forms
--------------------------------------+------------------------------------
Reporter: velle | Owner: Octowl
Type: Cleanup/optimization | Status: assigned
Component: Documentation | Version: master
Severity: Normal | Resolution:
Keywords: afraid-to-commit | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------

Comment (by Octowl):

Created a pull request at:

https://github.com/django/django/pull/3187

--
Ticket URL: <https://code.djangoproject.com/ticket/23307#comment:7>

Django

unread,
Sep 6, 2014, 7:35:45 PM9/6/14
to django-...@googlegroups.com
#23307: max_num limits total number of forms, not empty forms
--------------------------------------+------------------------------------
Reporter: velle | Owner: Octowl
Type: Cleanup/optimization | Status: assigned
Component: Documentation | Version: master
Severity: Normal | Resolution:
Keywords: afraid-to-commit | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by collinanderson):

* has_patch: 0 => 1


--
Ticket URL: <https://code.djangoproject.com/ticket/23307#comment:8>

Django

unread,
Sep 8, 2014, 1:22:36 PM9/8/14
to django-...@googlegroups.com
#23307: max_num limits total number of forms, not empty forms
--------------------------------------+------------------------------------
Reporter: velle | Owner: Octowl
Type: Cleanup/optimization | Status: closed
Component: Documentation | Version: master
Severity: Normal | Resolution: fixed

Keywords: afraid-to-commit | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by Tim Graham <timograham@…>):

* status: assigned => closed
* resolution: => fixed


Comment:

In [changeset:"5f3806b8612efca45dba1a75b29ad1bbbc12a7ca"]:
{{{
#!CommitTicketReference repository=""
revision="5f3806b8612efca45dba1a75b29ad1bbbc12a7ca"
Fixed #23307 -- Clarified the way max_num limits the output of formsets.

Thanks velle for the report.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/23307#comment:9>

Django

unread,
Sep 8, 2014, 1:25:00 PM9/8/14
to django-...@googlegroups.com
#23307: max_num limits total number of forms, not empty forms
--------------------------------------+------------------------------------
Reporter: velle | Owner: Octowl
Type: Cleanup/optimization | Status: closed
Component: Documentation | Version: master
Severity: Normal | Resolution: fixed
Keywords: afraid-to-commit | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------

Comment (by Tim Graham <timograham@…>):

In [changeset:"731654197cfbc49296c0d5869aae698b315440e9"]:
{{{
#!CommitTicketReference repository=""
revision="731654197cfbc49296c0d5869aae698b315440e9"
[1.6.x] Fixed #23307 -- Clarified the way max_num limits the output of
formsets.

Thanks velle for the report.

Backport of 5f3806b861 from master
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/23307#comment:10>

Django

unread,
Sep 8, 2014, 1:25:03 PM9/8/14
to django-...@googlegroups.com
#23307: max_num limits total number of forms, not empty forms
--------------------------------------+------------------------------------
Reporter: velle | Owner: Octowl
Type: Cleanup/optimization | Status: closed
Component: Documentation | Version: master
Severity: Normal | Resolution: fixed
Keywords: afraid-to-commit | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------

Comment (by Tim Graham <timograham@…>):

In [changeset:"813619405b4920c44f455b23ef407c6c66eb5746"]:
{{{
#!CommitTicketReference repository=""
revision="813619405b4920c44f455b23ef407c6c66eb5746"
[1.7.x] Fixed #23307 -- Clarified the way max_num limits the output of
formsets.

Thanks velle for the report.

Backport of 5f3806b861 from master
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/23307#comment:11>

Reply all
Reply to author
Forward
0 new messages