Code

Ticket #664: django-docs-manytomany-singular.diff

File django-docs-manytomany-singular.diff, 1.1 KB (added by L.Plant.98@…, 8 years ago)

description of the 'singular' argument in the docs

Line 
1Index: model-api.txt
2===================================================================
3--- model-api.txt       (revision 982)
4+++ model-api.txt       (working copy)
5@@ -621,6 +621,15 @@
6                              vertically).
7 
8     ``limit_choices_to``     See the description under ``ForeignKey`` above.
9+
10+    ``singular``             The singular name of the field, which is used to make
11+                             the ``get`` methods.  Normally, using the example given
12+                             above, Django would give the Pizza objects methods
13+                             like ``get_topping_list()`` where ``topping`` is the
14+                             singular and is derived from the lowercase version of the
15+                             class being linked to.  Use the 'singular' parameter to
16+                             change this - you need this if you have more than one
17+                             ManyToMany relationship to the same class.
18     =======================  ============================================================
19 
20 One-to-one relationships