Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed #20409 -- Clarified how unique_for_date works when USE_TZ is set.

  • Loading branch information...
commit e192739b3e3209a371a5d0f5f05fd083e88259f2 1 parent 31e16c1
@aaugustin aaugustin authored
Showing with 3 additions and 1 deletion.
  1. +3 −1 docs/ref/models/fields.txt
View
4 docs/ref/models/fields.txt
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.