diff options
| author | Luke Plant <L.Plant.98@cantab.net> | 2019-04-22 09:31:08 +0300 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2019-04-24 10:33:05 +0200 |
| commit | 46416554f3a7a97f529aea89e3246076a09a7b19 (patch) | |
| tree | ef5242dead131ac22486bdc430febe40ceedf107 /docs/ref | |
| parent | 88bf635c356b4d3a47e88dc4142b90060ce3c2ef (diff) | |
[2.2.x] Changed tuple Mate.unique_together/permissions to lists in docs.
Backport of 0c916255eb4d94e06e123fafec93efdba45b1259 from master
Diffstat (limited to 'docs/ref')
| -rw-r--r-- | docs/ref/models/options.txt | 12 |
1 files changed, 6 insertions, 6 deletions
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 |
