mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
Changed tuple Mate.unique_together/permissions to lists in docs.
This commit is contained in:
committed by
Mariusz Felisiak
parent
607ff4efa3
commit
0c916255eb
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user