mirror of
https://github.com/django/django.git
synced 2025-07-19 17:19:12 +00:00
[1.9.x] Refs #26142 -- Documented that Formset's extra=0 doesn't prevent creating objects.
Backport of 8e6a08e937272f088902cdbec65a9f2e919783bf from master
This commit is contained in:
parent
dee5896b55
commit
204d31cd60
@ -931,6 +931,12 @@ extra forms displayed.
|
|||||||
>>> [x.name for x in formset.get_queryset()]
|
>>> [x.name for x in formset.get_queryset()]
|
||||||
['Charles Baudelaire', 'Paul Verlaine', 'Walt Whitman']
|
['Charles Baudelaire', 'Paul Verlaine', 'Walt Whitman']
|
||||||
|
|
||||||
|
Also, ``extra=0`` doesn't prevent creation of new model instances as you can
|
||||||
|
:ref:`add additional forms with JavaScript <understanding-the-managementform>`
|
||||||
|
or just send additional POST data. Formsets `don't yet provide functionality
|
||||||
|
<https://code.djangoproject.com/ticket/26142>`_ for an "edit only" view that
|
||||||
|
prevents creation of new instances.
|
||||||
|
|
||||||
If the value of ``max_num`` is greater than the number of existing related
|
If the value of ``max_num`` is greater than the number of existing related
|
||||||
objects, up to ``extra`` additional blank forms will be added to the formset,
|
objects, up to ``extra`` additional blank forms will be added to the formset,
|
||||||
so long as the total number of forms does not exceed ``max_num``::
|
so long as the total number of forms does not exceed ``max_num``::
|
||||||
|
Loading…
x
Reference in New Issue
Block a user