mirror of
https://github.com/django/django.git
synced 2025-08-03 18:38:50 +00:00
Fixed #9061 -- Allowed FormSets to disable deleting extra forms.
Thanks to Dan Ward for the initial patch.
This commit is contained in:
parent
2e8941b6f9
commit
162765d6c3
8 changed files with 135 additions and 14 deletions
|
@ -593,6 +593,18 @@ On the other hand, if you are using a plain ``FormSet``, it's up to you to
|
|||
handle ``formset.deleted_forms``, perhaps in your formset's ``save()`` method,
|
||||
as there's no general notion of what it means to delete a form.
|
||||
|
||||
``can_delete_extra``
|
||||
--------------------
|
||||
|
||||
.. versionadded:: 3.2
|
||||
|
||||
.. attribute:: BaseFormSet.can_delete_extra
|
||||
|
||||
Default: ``True``
|
||||
|
||||
While setting ``can_delete=True``, specifying ``can_delete_extra=False`` will
|
||||
remove the option to delete extra forms.
|
||||
|
||||
Adding additional fields to a formset
|
||||
=====================================
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue