Kaydet (Commit) 55ffcf8e authored tarafından Raúl Cumplido's avatar Raúl Cumplido Kaydeden (comit) Tim Graham

Fixed #18145 -- Improved documentation of unique_together type fields

üst 03896eb5
...@@ -244,12 +244,12 @@ Django quotes column and table names behind the scenes. ...@@ -244,12 +244,12 @@ Django quotes column and table names behind the scenes.
unique_together = (("driver", "restaurant"),) 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 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`` appropriate ``UNIQUE`` statements are included in the ``CREATE TABLE``
statement). 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:: set of fields::
unique_together = ("driver", "restaurant") unique_together = ("driver", "restaurant")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment