diff options
| author | Clifford Gama <cliffygamy@gmail.com> | 2024-09-10 22:38:01 +0200 |
|---|---|---|
| committer | Sarah Boyce <42296566+sarahboyce@users.noreply.github.com> | 2024-09-19 15:19:08 +0200 |
| commit | e1d226bc1c52a0165164e5b34fef1d336050ca60 (patch) | |
| tree | da785fdf59a4bdaf12ab50840e261d4976da01bb /docs/ref | |
| parent | 4b65dc2f217d705ad9438212f38a31ac8c7d58ba (diff) | |
Fixed #35748 -- Documented that fields are excluded from a ModelForm when formfield() returns None.
Co-authored-by: Sarah Boyce <42296566+sarahboyce@users.noreply.github.com>
Diffstat (limited to 'docs/ref')
| -rw-r--r-- | docs/ref/models/fields.txt | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/docs/ref/models/fields.txt b/docs/ref/models/fields.txt index 5266135dd2..899947c17f 100644 --- a/docs/ref/models/fields.txt +++ b/docs/ref/models/fields.txt @@ -2445,6 +2445,9 @@ Field API reference Returns the default :class:`django.forms.Field` of this field for :class:`~django.forms.ModelForm`. + If :meth:`~Field.formfield` is overridden to return ``None``, this field + is excluded from the :class:`~django.forms.ModelForm`. + By default, if both ``form_class`` and ``choices_form_class`` are ``None``, it uses :class:`~django.forms.CharField`. If the field has :attr:`~django.db.models.Field.choices` and ``choices_form_class`` |
