mirror of
https://github.com/django/django.git
synced 2025-10-24 14:16:09 +00:00
Fixed #12508 - Added ability to dynamically add inlines in the admin app.
Refs #13. Also introduces an ``empty_form`` attribute on formsets to make it easier to implement dynamic forms. Many thanks to Zain Memon for the initial patch from his Summer of Code 2009 project, Stanislaus Madueke for his django-dynamic-formset app and all the other people helping out. git-svn-id: http://code.djangoproject.com/svn/django/trunk@12297 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
@@ -1036,6 +1036,9 @@ This controls the number of extra forms the formset will display in addition
|
||||
to the initial forms. See the
|
||||
:ref:`formsets documentation <topics-forms-formsets>` for more information.
|
||||
|
||||
Extra forms for inlines will be hidden and replaced with a link to dynamically
|
||||
add any number of new inlines for users with Javascript enabled.
|
||||
|
||||
``max_num``
|
||||
~~~~~~~~~~~
|
||||
|
||||
|
||||
@@ -154,6 +154,15 @@ 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.
|
||||
|
||||
.. versionadded:: 1.2
|
||||
|
||||
``empty_form``
|
||||
~~~~~~~~~~~~~~
|
||||
|
||||
``BaseFormSet`` provides an additional attribute ``empty_form`` which returns
|
||||
a form instance with a prefix of ``__prefix__`` for easier use in dynamic
|
||||
forms with JavaScript.
|
||||
|
||||
Custom formset validation
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
|
||||
Reference in New Issue
Block a user