mirror of
https://github.com/django/django.git
synced 2025-08-04 19:08:28 +00:00
Fixed #17416 -- Added widgets argument to inlineformset_factory and modelformset_factory
This commit is contained in:
parent
71c8539570
commit
93e79b45bc
4 changed files with 66 additions and 9 deletions
|
@ -25,12 +25,12 @@ Model Form Functions
|
|||
|
||||
See :ref:`modelforms-factory` for example usage.
|
||||
|
||||
.. function:: modelformset_factory(model, form=ModelForm, formfield_callback=None, formset=BaseModelFormSet, extra=1, can_delete=False, can_order=False, max_num=None, fields=None, exclude=None)
|
||||
.. function:: modelformset_factory(model, form=ModelForm, formfield_callback=None, formset=BaseModelFormSet, extra=1, can_delete=False, can_order=False, max_num=None, fields=None, exclude=None, widgets=None)
|
||||
|
||||
Returns a ``FormSet`` class for the given ``model`` class.
|
||||
|
||||
Arguments ``model``, ``form``, ``fields``, ``exclude``, and
|
||||
``formfield_callback`` are all passed through to
|
||||
Arguments ``model``, ``form``, ``fields``, ``exclude``,
|
||||
``formfield_callback`` and ``widgets`` are all passed through to
|
||||
:func:`~django.forms.models.modelform_factory`.
|
||||
|
||||
Arguments ``formset``, ``extra``, ``max_num``, ``can_order``, and
|
||||
|
@ -39,7 +39,11 @@ Model Form Functions
|
|||
|
||||
See :ref:`model-formsets` for example usage.
|
||||
|
||||
.. function:: inlineformset_factory(parent_model, model, form=ModelForm, formset=BaseInlineFormSet, fk_name=None, fields=None, exclude=None, extra=3, can_order=False, can_delete=True, max_num=None, formfield_callback=None)
|
||||
.. versionchanged:: 1.6
|
||||
|
||||
The widgets parameter was added.
|
||||
|
||||
.. function:: inlineformset_factory(parent_model, model, form=ModelForm, formset=BaseInlineFormSet, fk_name=None, fields=None, exclude=None, extra=3, can_order=False, can_delete=True, max_num=None, formfield_callback=None, widgets=None)
|
||||
|
||||
Returns an ``InlineFormSet`` using :func:`modelformset_factory` with
|
||||
defaults of ``formset=BaseInlineFormSet``, ``can_delete=True``, and
|
||||
|
@ -49,3 +53,7 @@ Model Form Functions
|
|||
the ``parent_model``, you must specify a ``fk_name``.
|
||||
|
||||
See :ref:`inline-formsets` for example usage.
|
||||
|
||||
.. versionchanged:: 1.6
|
||||
|
||||
The widgets parameter was added.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue