Fixed #22224 -- Added note about supplying missing values for non-nullable fields with blank=True.

This commit is contained in:
Jacob Walls 2021-09-30 21:40:01 -04:00 committed by Mariusz Felisiak
parent d400b08a8b
commit cd6bddd44e
1 changed files with 6 additions and 0 deletions

View File

@ -73,6 +73,12 @@ purely database-related, whereas :attr:`~Field.blank` is validation-related. If
a field has ``blank=True``, form validation will allow entry of an empty value. a field has ``blank=True``, form validation will allow entry of an empty value.
If a field has ``blank=False``, the field will be required. If a field has ``blank=False``, the field will be required.
.. admonition:: Supplying missing values
``blank=True`` can be used with fields having ``null=False``, but this will
require implementing :meth:`~django.db.models.Model.clean` on the model in
order to programmatically supply any missing values.
.. _field-choices: .. _field-choices:
``choices`` ``choices``