diff options
| author | Aaron Cannon <cannona@fireantproductions.com> | 2013-05-03 08:46:53 -0500 |
|---|---|---|
| committer | Aaron Cannon <cannona@fireantproductions.com> | 2013-05-03 08:46:53 -0500 |
| commit | 291250f7b66a6b81d2fc64eecc82cb2b4bd6c090 (patch) | |
| tree | 293d9e6eb0420b28c91173ec44959fe59bd8f1d0 /docs | |
| parent | d48b7230a8b8d44607b19749fb4a0a8a25d50cf1 (diff) | |
Added clarification to the docs, pointing out that unique_for_date only considers the date portion of DateTime fields.
Diffstat (limited to 'docs')
| -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 d322904ec9..99ba78cb09 100644 --- a/docs/ref/models/fields.txt +++ b/docs/ref/models/fields.txt @@ -287,6 +287,9 @@ For example, if you have a field ``title`` that has ``unique_for_date="pub_date"``, then Django wouldn't allow the entry of two 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. + This is enforced by model validation but not at the database level. ``unique_for_month`` |
