Fixed #30063 -- Doc'd that Meta.unique_together may be deprecated in favor of Meta.constraints.

This commit is contained in:
Paveł Tyślacki 2018-12-27 22:43:30 +03:00 committed by Tim Graham
parent b71e3d635a
commit bdf3863bdd
1 changed files with 6 additions and 0 deletions

View File

@ -404,6 +404,12 @@ Django quotes column and table names behind the scenes.
.. attribute:: Options.unique_together
.. admonition:: Use :class:`.UniqueConstraint` with the :attr:`~Options.constraints` option instead.
:class:`.UniqueConstraint` provides more functionality than
``unique_together``. ``unique_together`` may be deprecated in the
future.
Sets of field names that, taken together, must be unique::
unique_together = (("driver", "restaurant"),)