Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

[1.2.X] Fixed #14477 -- Corrects several instances of "add" and "remo…

…ve" m2m_changed signal actions not having been updated to "pre_add", "post_add", etc. Thanks to slink and andrews for reporting several instances of it, and andrews for the draft patch.

Backport of [14304] from trunk.

git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.2.X@14305 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit b855dbf676a496c2d3ac1ea6bec5ebe8e4cc5590 1 parent 1160d81
Gabriel Hurley authored
Showing with 8 additions and 7 deletions.
  1. +8 −7 docs/ref/signals.txt
15 docs/ref/signals.txt
View
@@ -213,18 +213,19 @@ Arguments sent with this signal:
Sent *after* the relation is cleared
``reverse``
- Indicates which side of the relation is updated (i.e., if it is the
- forward or reverse relation that is being modified).
+ Indicates which side of the relation is updated (i.e., if it is the
+ forward or reverse relation that is being modified).
``model``
The class of the objects that are added to, removed from or cleared
from the relation.
``pk_set``
- With the ``"add"`` and ``"remove"`` action, this is a list of
- primary key values that have been added to or removed from the relation.
+ For the ``pre_add``, ``post_add``, ``pre_remove`` and ``post_remove``
+ actions, this is a list of primary key values that have been added to
+ or removed from the relation.
- For the ``"clear"`` action, this is ``None``.
+ For the ``pre_clear`` and ``post_clear`` actions, this is ``None``.
For example, if a ``Pizza`` can have multiple ``Topping`` objects, modeled
like this:
@@ -255,7 +256,7 @@ the arguments sent to a :data:`m2m_changed` handler would be:
``instance`` ``p`` (the ``Pizza`` instance being modified)
- ``action`` ``"add"``
+ ``action`` ``"pre_add"`` (followed by a separate signal with ``"post_add"``)
``reverse`` ``False`` (``Pizza`` contains the :class:`ManyToManyField`,
so this call modifies the forward relation)
@@ -281,7 +282,7 @@ the arguments sent to a :data:`m2m_changed` handler would be:
``instance`` ``t`` (the ``Topping`` instance being modified)
- ``action`` ``"remove"``
+ ``action`` ``"pre_remove"`` (followed by a separate signal with ``"post_remove"``)
``reverse`` ``True`` (``Pizza`` contains the :class:`ManyToManyField`,
so this call modifies the reverse relation)
Please sign in to comment.
Something went wrong with that request. Please try again.