From 46416554f3a7a97f529aea89e3246076a09a7b19 Mon Sep 17 00:00:00 2001 From: Luke Plant Date: Mon, 22 Apr 2019 09:31:08 +0300 Subject: [2.2.x] Changed tuple Mate.unique_together/permissions to lists in docs. Backport of 0c916255eb4d94e06e123fafec93efdba45b1259 from master --- docs/ref/models/options.txt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'docs/ref') diff --git a/docs/ref/models/options.txt b/docs/ref/models/options.txt index e06a099a61..ffc8d51808 100644 --- a/docs/ref/models/options.txt +++ b/docs/ref/models/options.txt @@ -309,7 +309,7 @@ Django quotes column and table names behind the scenes. Add, change, delete, and view permissions are automatically created for each model. This example specifies an extra permission, ``can_deliver_pizzas``:: - permissions = (("can_deliver_pizzas", "Can deliver pizzas"),) + permissions = [('can_deliver_pizzas', 'Can deliver pizzas')] This is a list or tuple of 2-tuples in the format ``(permission_code, human_readable_permission_name)``. @@ -412,17 +412,17 @@ Django quotes column and table names behind the scenes. Sets of field names that, taken together, must be unique:: - unique_together = (("driver", "restaurant"),) + unique_together = [['driver', 'restaurant']] - This is a tuple of tuples that must be unique when considered together. + This is a list of lists 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 tuple when dealing with a single - set of fields:: + For convenience, ``unique_together`` can be a single list when dealing with + a single set of fields:: - unique_together = ("driver", "restaurant") + unique_together = ['driver', 'restaurant'] A :class:`~django.db.models.ManyToManyField` cannot be included in unique_together. (It's not clear what that would even mean!) If you -- cgit v1.3