mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
This is backwards-incompatible if you were doing things to 'initial' in BaseModelFormSet.__init__, or if you relied on the internal _total_form_count or _initial_form_count attributes of BaseFormSet. Those attributes are now public methods. git-svn-id: http://code.djangoproject.com/svn/django/trunk@10190 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
@@ -133,6 +133,20 @@ It is used to keep track of how many form instances are being displayed. If
|
||||
you are adding new forms via JavaScript, you should increment the count fields
|
||||
in this form as well.
|
||||
|
||||
.. versionadded:: 1.1
|
||||
|
||||
``total_form_count`` and ``initial_form_count``
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
``BaseModelFormSet`` has a couple of methods that are closely related to the
|
||||
``ManagementForm``, ``total_form_count`` and ``initial_form_count``.
|
||||
|
||||
``total_form_count`` returns the total number of forms in this formset.
|
||||
``initial_form_count`` returns the number of forms in the formset that were
|
||||
pre-filled, and is also used to determine how many forms are required. You
|
||||
will probably never need to override either of these methods, so please be
|
||||
sure you understand what they do before doing so.
|
||||
|
||||
Custom formset validation
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
|
||||
Reference in New Issue
Block a user