diff --git a/docs/ref/forms/formsets.txt b/docs/ref/forms/formsets.txt index 8adf9499ab..0e2db86faf 100644 --- a/docs/ref/forms/formsets.txt +++ b/docs/ref/forms/formsets.txt @@ -19,7 +19,8 @@ Creating Formsets It is the base class from which every FormSet class is derived. Following attributes and methods are available in this class - see the :doc:`topics` page for examples on how to use them + see the :doc:`topics` page for examples on + how to use them There are two ways to create formsets in Django: @@ -90,5 +91,4 @@ Declarative ``FormSet`` ... can_delete_extra = False ... renderer = None ... - diff --git a/docs/ref/forms/models.txt b/docs/ref/forms/models.txt index 2c103baab6..403adec2fe 100644 --- a/docs/ref/forms/models.txt +++ b/docs/ref/forms/models.txt @@ -259,14 +259,16 @@ Declarative ``ModelFormSet`` .. class:: ModelFormSet - A BaseModelFormSet subclass that allows declarative declaration of model formsets. + A BaseModelFormSet subclass that allows declarative declaration of + model formsets. .. versionadded:: 5.1 Returns a ``ModelFormSet`` class for the given ``model`` class. - The same arguments that can be passed to the ``modelformset_factory`` - function can also be passed to the declarative syntax. + The same arguments that can be passed to the + ``modelformset_factory`` function can also be passed to the + declarative syntax. See the following example which shows how to create AuthorFormSet from ``Author`` model:: @@ -333,15 +335,16 @@ Declarative ``InlineFormSet`` .. class:: InlineFormSet - A BaseInlineFormSet subclass that allows declarative declaration of model formsets. + A BaseInlineFormSet subclass that allows declarative declaration of + model formsets. .. versionadded:: 5.1 Returns a ``InlineFormSet`` class for the given ``parent_model`` and ``model`` class. - The Declarative ``InlineFormSet`` class takes the same arguments as the - :func:`inlineformset_factory` function. + The Declarative ``InlineFormSet`` class takes the same arguments as + the :func:`inlineformset_factory` function. .. code-block:: pycon diff --git a/docs/topics/forms/formsets.txt b/docs/topics/forms/formsets.txt index b0a2fd1395..0c2fc60c7a 100644 --- a/docs/topics/forms/formsets.txt +++ b/docs/topics/forms/formsets.txt @@ -506,12 +506,14 @@ number of forms should use custom formset validation. If ``validate_max=True`` is passed to :func:`~django.forms.formsets.formset_factory`, validation will also check -that the number of forms in the data set, minus those marked for deletion, is -less than or equal to ``max_num``. +that the number of forms in the data set, minus those marked for deletion, +is less than or equal to ``max_num``. >>> from django.forms import formset_factory >>> from myapp.forms import ArticleForm - >>> ArticleFormSet = formset_factory(ArticleForm, max_num=1, validate_max=True) + >>> ArticleFormSet = formset_factory( + ... ArticleForm, max_num=1, validate_max=True + ... ) >>> data = { ... 'form-TOTAL_FORMS': '2', ... 'form-INITIAL_FORMS': '0', @@ -549,12 +551,14 @@ to the :ref:`formsets-error-messages` argument. If ``validate_min=True`` is passed to :func:`~django.forms.formsets.formset_factory`, validation will also check -that the number of forms in the data set, minus those marked for deletion, is -greater than or equal to ``min_num``. +that the number of forms in the data set, minus those marked for deletion, +is greater than or equal to ``min_num``. >>> from django.forms import formset_factory >>> from myapp.forms import ArticleForm - >>> ArticleFormSet = formset_factory(ArticleForm, min_num=3, validate_min=True) + >>> ArticleFormSet = formset_factory( + ... ArticleForm, min_num=3, validate_min=True + ... ) >>> data = { ... 'form-TOTAL_FORMS': '2', ... 'form-INITIAL_FORMS': '0',