mirror of
https://github.com/django/django.git
synced 2025-07-19 03:05:32 +00:00
Fixed #21798 -- Added check for DateTime mutually exclusive options
Added DateTimeCheckMixin to avoid the use of default, auto_now, and auto_now_add options together. Added the fields.E151 Error that is raised if one or more of these options are used together.
This commit is contained in:
parent
8a9d54aa69
commit
cb15231888
4 changed files with 64 additions and 2 deletions
|
@ -477,6 +477,9 @@ The default form widget for this field is a
|
|||
and a shortcut for "Today". Includes an additional ``invalid_date`` error
|
||||
message key.
|
||||
|
||||
The options ``auto_now_add``, ``auto_now``, and ``default`` are mutually exclusive.
|
||||
Any combination of these options will result in an error.
|
||||
|
||||
.. note::
|
||||
As currently implemented, setting ``auto_now`` or ``auto_now_add`` to
|
||||
``True`` will cause the field to have ``editable=False`` and ``blank=True``
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue