0
0
mirror of https://github.com/django/django.git synced 2024-12-01 15:42:04 +01:00

Fixed #18145 -- Improved documentation of unique_together type fields

This commit is contained in:
Raúl Cumplido 2012-06-07 13:46:06 +02:00 committed by Tim Graham
parent 03896eb5df
commit 55ffcf8e7b

View File

@ -244,12 +244,12 @@ Django quotes column and table names behind the scenes.
unique_together = (("driver", "restaurant"),)
This is a list of lists of fields that must be unique when considered together.
This is a tuple of tuples that must be unique when considered together.
It's used in the Django admin and is enforced at the database level (i.e., the
appropriate ``UNIQUE`` statements are included in the ``CREATE TABLE``
statement).
For convenience, unique_together can be a single list when dealing with a single
For convenience, unique_together can be a single tuple when dealing with a single
set of fields::
unique_together = ("driver", "restaurant")