diff options
| author | Clifford Gama <53076065+cliff688@users.noreply.github.com> | 2025-03-13 20:18:35 +0200 |
|---|---|---|
| committer | Natalia <124304+nessita@users.noreply.github.com> | 2025-03-13 15:23:55 -0300 |
| commit | 91971013a1d56917338bad63aee7b831019859db (patch) | |
| tree | 586a8d983625f6ae3c8a1b216291b3890d838b6c /docs/topics/forms/modelforms.txt | |
| parent | 0a61485092f2e664446d449c3eed971e240a44ed (diff) | |
[5.2.x] Fixed incorrect formatting for inline pluralized code references in docs.
Backport of efe3ca09e029c63e25f6e19843cb0c68cc7fa816 from main.
Diffstat (limited to 'docs/topics/forms/modelforms.txt')
| -rw-r--r-- | docs/topics/forms/modelforms.txt | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/docs/topics/forms/modelforms.txt b/docs/topics/forms/modelforms.txt index e2a37296b7..ce9f842828 100644 --- a/docs/topics/forms/modelforms.txt +++ b/docs/topics/forms/modelforms.txt @@ -696,10 +696,10 @@ will be localized. Form inheritance ---------------- -As with basic forms, you can extend and reuse ``ModelForms`` by inheriting -them. This is useful if you need to declare extra fields or extra methods on a -parent class for use in a number of forms derived from models. For example, -using the previous ``ArticleForm`` class: +As with basic forms, you can extend and reuse ``ModelForm`` classes by +inheriting them. This is useful if you need to declare extra fields or extra +methods on a parent class for use in a number of forms derived from models. +For example, using the previous ``ArticleForm`` class: .. code-block:: pycon @@ -979,7 +979,7 @@ value (``instances``, in the above example). When fields are missing from the form (for example because they have been excluded), these fields will not be set by the ``save()`` method. You can find more information about this restriction, which also holds for regular -``ModelForms``, in `Selecting the fields to use`_. +model forms, in `Selecting the fields to use`_. Pass ``commit=False`` to return the unsaved model instances: @@ -1100,7 +1100,7 @@ above, in :ref:`saving-objects-in-the-formset`.) Overriding ``clean()`` on a ``ModelFormSet`` -------------------------------------------- -Just like with ``ModelForms``, by default the ``clean()`` method of a +Just like with a ``ModelForm``, by default the ``clean()`` method of a ``ModelFormSet`` will validate that none of the items in the formset violate the unique constraints on your model (either ``unique``, ``unique_together`` or ``unique_for_date|month|year``). If you want to override the ``clean()`` method |
