Ticket #5390: m2msignals_doc.txt

File m2msignals_doc.txt, 1001 bytes (added by ludo@…, 14 years ago)

patch for the db-api docs

1Index: docs/db-api.txt
3--- docs/db-api.txt     (revision 7028)
4+++ docs/db-api.txt     (working copy)
5@@ -225,6 +225,19 @@
7 Django will complain if you try to assign or add an object of the wrong type.
9+When you update a ``ManyToManyField``, Django will emit a signal that
10+provides a notification of the changes. The raised signals are:
12+    * **``m2m_add_items``** gets fired after new objects are added to the
13+      ``ManyToManyField``, and passes the list of newly added objects to
14+      listeners
15+    * **``m2m_remove_items``** gets fired after existing objects are removed
16+      from the ``ManyToManyField``, and passes a list of removed objects
17+      to listeners
18+    * **``m2m_clear_items``** gets fired before all objects are cleared
19+      from the ``ManyToManyField``, and passes a list of the objects to be
20+      removed to listeners
22 How Django knows to UPDATE vs. INSERT
23 -------------------------------------
Back to Top