Skip to content

Commit

Permalink
[1.1.X] Fixed #12505 -- Clarified the use of the extra argument in fo…
Browse files Browse the repository at this point in the history
…rmsets. Thanks to Andreas for the report, and timo for the draft patch.

Backport of r13218 from trunk.

git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.1.X@13223 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information
freakboy3742 committed May 10, 2010
1 parent c51284f commit 9ca0a33
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions docs/topics/forms/formsets.txt
Expand Up @@ -29,9 +29,10 @@ would with a regular form::
<tr><th><label for="id_form-0-title">Title:</label></th><td><input type="text" name="form-0-title" id="id_form-0-title" /></td></tr>
<tr><th><label for="id_form-0-pub_date">Pub date:</label></th><td><input type="text" name="form-0-pub_date" id="id_form-0-pub_date" /></td></tr>

As you can see it only displayed one form. This is because by default the
``formset_factory`` defines one extra form. This can be controlled with the
``extra`` parameter::
As you can see it only displayed one empty form. The number of empty forms
that is displayed is controlled by the ``extra`` parameter. By default,
``formset_factory`` defines one extra form; the following example will
display two blank forms::

>>> ArticleFormSet = formset_factory(ArticleForm, extra=2)

Expand Down

0 comments on commit 9ca0a33

Please sign in to comment.