summaryrefslogtreecommitdiff
path: root/docs/model-api.txt
diff options
context:
space:
mode:
Diffstat (limited to 'docs/model-api.txt')
-rw-r--r--docs/model-api.txt13
1 files changed, 11 insertions, 2 deletions
diff --git a/docs/model-api.txt b/docs/model-api.txt
index fa6d8f10e6..edf94dd17c 100644
--- a/docs/model-api.txt
+++ b/docs/model-api.txt
@@ -621,6 +621,14 @@ the relationship should work. All are optional:
vertically).
``limit_choices_to`` See the description under ``ForeignKey`` above.
+
+ ``singular`` The singular name of the field. Use to name the ``get_*``
+ methods: in the example above, Django gives the ``Pizza``
+ objects a ``get_topping_list()`` method, where ``topping``
+ is the default ``singular`` value derived from the lowercase
+ version of the class being linked to. Use the singular
+ parameter to change this, which is if you want one model to
+ have multiple ``ManyToMany`` relationships to another model.
======================= ============================================================
One-to-one relationships
@@ -750,11 +758,12 @@ Here's a list of all possible ``META`` options. No options are required. Adding
``permissions``
Extra permissions to enter into the permissions table when creating this
object. Add, delete and change permissions are automatically created for
- each object. This option specifies extra permissions::
+ each object that has ``admin`` set. This example specifies an extra
+ permission, ``can_deliver_pizzas``::
permissions = (("can_deliver_pizzas", "Can deliver pizzas"),)
- This is a list of 2-tuples of
+ This is a list or tuple of 2-tuples in the format
``(permission_code, human_readable_permission_name)``.
``unique_together``