Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

[1.0.X] Fixed #11138 -- Corrected the description of behavior related…

… to the max_num parameter for model formsets.

r10819 from trunk.


git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@10820 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit ad2efbdd61f890a2e17d3d1391dbd90ea91626d1 1 parent efbe48c
Karen Tracey authored May 18, 2009

Showing 1 changed file with 5 additions and 4 deletions. Show diff stats Hide diff stats

  1. 9  docs/topics/forms/modelforms.txt
9  docs/topics/forms/modelforms.txt
@@ -520,7 +520,7 @@ Limiting the number of editable objects
520 520
 
521 521
 As with regular formsets, you can use the ``max_num`` parameter to
522 522
 ``modelformset_factory`` to limit the number of forms displayed. With
523  
-model formsets, this properly limits the query to select only the maximum
  523
+model formsets, this property limits the query to select only the maximum
524 524
 number of objects needed::
525 525
 
526 526
     >>> Author.objects.order_by('name')
@@ -531,10 +531,11 @@ number of objects needed::
531 531
     >>> formset.initial
532 532
     [{'id': 1, 'name': u'Charles Baudelaire'}, {'id': 3, 'name': u'Paul Verlaine'}]
533 533
 
534  
-If the value of ``max_num`` is less than the total objects returned, the
535  
-formset will fill the rest with extra forms::
  534
+If the value of ``max_num`` is higher than the number of objects returned, up to 
  535
+``extra`` additional blank forms will be added to the formset, so long as the 
  536
+total number of forms does not exceed ``max_num``::
536 537
 
537  
-    >>> AuthorFormSet = modelformset_factory(Author, max_num=4, extra=1)
  538
+    >>> AuthorFormSet = modelformset_factory(Author, max_num=4, extra=2)
538 539
     >>> formset = AuthorFormSet(queryset=Author.objects.order_by('name'))
539 540
     >>> for form in formset.forms:
540 541
     ...     print form.as_table()

0 notes on commit ad2efbd

Please sign in to comment.
Something went wrong with that request. Please try again.