Code

Ticket #19640: 19640.diff

File 19640.diff, 1.9 KB (added by timo, 15 months ago)
Line 
1diff --git a/docs/ref/forms/models.txt b/docs/ref/forms/models.txt
2index 1f4a0d0..3bbebc0 100644
3--- a/docs/ref/forms/models.txt
4+++ b/docs/ref/forms/models.txt
5@@ -5,7 +5,7 @@ Model Form Functions
6 .. module:: django.forms.models
7    :synopsis: Django's functions for building model forms and formsets.
8 
9-.. method:: modelform_factory(model, form=ModelForm, fields=None, exclude=None, formfield_callback=None,  widgets=None)
10+.. function:: modelform_factory(model, form=ModelForm, fields=None, exclude=None, formfield_callback=None,  widgets=None)
11 
12     Returns a :class:`~django.forms.ModelForm` class for the given ``model``.
13     You can optionally pass a ``form`` argument to use as a starting point for
14@@ -25,7 +25,7 @@ Model Form Functions
15 
16     See :ref:`modelforms-factory` for example usage.
17 
18-.. method:: 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)
19+.. 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)
20 
21     Returns a ``FormSet`` class for the given ``model`` class.
22 
23@@ -38,3 +38,12 @@ Model Form Functions
24     :ref:`formsets` for details.
25 
26     See :ref:`model-formsets` for example usage.
27+
28+.. 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)
29+
30+    Returns an ``InlineFormSet`` using :func:`modelformset_factory` with
31+    defaults of ``formset=BaseInlineFormSet``, ``can_delete=True``, and
32+    ``extra=3``.
33+
34+    If your model has more than one :class:`~django.db.models.ForeignKey` to
35+    the ``parent_model``, you must specify a ``fk_name``.