[1.5.x] Fixed #19640 - Added inlineformset_factory to reference docs.

Thanks wim@ for the suggestion.

Backport of 5b2d9bacd2 from master
This commit is contained in:
Tim Graham 2013-01-22 06:46:22 -05:00
parent 5f3c45f745
commit 34718395ed
3 changed files with 22 additions and 8 deletions

View file

@ -550,7 +550,7 @@ ModelForm factory function
--------------------------
You can create forms from a given model using the standalone function
:class:`~django.forms.models.modelform_factory`, instead of using a class
:func:`~django.forms.models.modelform_factory`, instead of using a class
definition. This may be more convenient if you do not have many customizations
to make::
@ -859,6 +859,8 @@ primary key that isn't called ``id``, make sure it gets rendered.)
.. highlight:: python
.. _inline-formsets:
Inline formsets
===============
@ -883,7 +885,7 @@ a particular author, you could do this::
.. note::
``inlineformset_factory`` uses
:func:`~django.forms.models.inlineformset_factory` uses
:func:`~django.forms.models.modelformset_factory` and marks
``can_delete=True``.
@ -903,7 +905,8 @@ the following model::
to_friend = models.ForeignKey(Friend)
length_in_months = models.IntegerField()
To resolve this, you can use ``fk_name`` to ``inlineformset_factory``::
To resolve this, you can use ``fk_name`` to
:func:`~django.forms.models.inlineformset_factory`::
>>> FriendshipFormSet = inlineformset_factory(Friend, Friendship, fk_name="from_friend")