mirror of
https://github.com/django/django.git
synced 2024-12-01 15:42:04 +01:00
Fixed #20409 -- Clarified how unique_for_date works when USE_TZ is set.
This commit is contained in:
parent
31e16c1343
commit
e192739b3e
@ -300,7 +300,9 @@ For example, if you have a field ``title`` that has
|
||||
records with the same ``title`` and ``pub_date``.
|
||||
|
||||
Note that if you set this to point to a :class:`DateTimeField`, only the date
|
||||
portion of the field will be considered.
|
||||
portion of the field will be considered. Besides, when :setting:`USE_TZ` is
|
||||
``True``, the check will be performed in the :ref:`current time zone
|
||||
<default-current-time-zone>` at the time the object gets saved.
|
||||
|
||||
This is enforced by :meth:`Model.validate_unique()` during model validation
|
||||
but not at the database level. If any :attr:`~Field.unique_for_date` constraint
|
||||
|
Loading…
Reference in New Issue
Block a user