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/topics | |
| 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/topics')
| -rw-r--r-- | docs/topics/auth/customizing.txt | 4 | ||||
| -rw-r--r-- | docs/topics/auth/default.txt | 4 | ||||
| -rw-r--r-- | docs/topics/serialization.txt | 6 |
3 files changed, 7 insertions, 7 deletions
diff --git a/docs/topics/auth/customizing.txt b/docs/topics/auth/customizing.txt index 87988873a4..5c01067a75 100644 --- a/docs/topics/auth/customizing.txt +++ b/docs/topics/auth/customizing.txt @@ -277,10 +277,10 @@ can or cannot do with ``Task`` instances, specific to your application:: class Task(models.Model): ... class Meta: - permissions = ( + permissions = [ ("change_task_status", "Can change the status of tasks"), ("close_task", "Can remove a task by setting its status as closed"), - ) + ] The only thing this does is create those extra permissions when you run :djadmin:`manage.py migrate <migrate>` (the function that creates permissions diff --git a/docs/topics/auth/default.txt b/docs/topics/auth/default.txt index 640130beb0..a1c0e32ce0 100644 --- a/docs/topics/auth/default.txt +++ b/docs/topics/auth/default.txt @@ -328,12 +328,12 @@ inherit the permissions of the concrete model they subclass:: class Person(models.Model): class Meta: - permissions = (('can_eat_pizzas', 'Can eat pizzas'),) + permissions = [('can_eat_pizzas', 'Can eat pizzas')] class Student(Person): class Meta: proxy = True - permissions = (('can_deliver_pizzas', 'Can deliver pizzas'),) + permissions = [('can_deliver_pizzas', 'Can deliver pizzas')] >>> # Fetch the content type for the proxy model. >>> content_type = ContentType.objects.get_for_model(Student, for_concrete_model=False) diff --git a/docs/topics/serialization.txt b/docs/topics/serialization.txt index e4e92fca43..11d07bf301 100644 --- a/docs/topics/serialization.txt +++ b/docs/topics/serialization.txt @@ -367,7 +367,7 @@ Consider the following two models:: birthdate = models.DateField() class Meta: - unique_together = (('first_name', 'last_name'),) + unique_together = [['first_name', 'last_name']] class Book(models.Model): name = models.CharField(max_length=100) @@ -411,7 +411,7 @@ name:: objects = PersonManager() class Meta: - unique_together = (('first_name', 'last_name'),) + unique_together = [['first_name', 'last_name']] Now books can use that natural key to refer to ``Person`` objects:: @@ -459,7 +459,7 @@ Firstly, you need to add another method -- this time to the model itself:: objects = PersonManager() class Meta: - unique_together = (('first_name', 'last_name'),) + unique_together = [['first_name', 'last_name']] def natural_key(self): return (self.first_name, self.last_name) |
