summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorJeremy Lainé <jeremy.laine@m4x.org>2018-05-26 12:03:05 +0200
committerTim Graham <timograham@gmail.com>2018-06-08 14:36:17 -0400
commit741792961815cf4a95c5ce8ab590dfc7700c6153 (patch)
treead3f8a7a0a889d12f6d6184d4e19e600a2203213 /docs
parent56611a96df7172ab9a5e3b2ac19dc3fb83add722 (diff)
Fixed #29440 -- Doc'd where the bulk argument applies in RelatedManager.
Diffstat (limited to 'docs')
-rw-r--r--docs/ref/models/relations.txt16
1 files changed, 13 insertions, 3 deletions
diff --git a/docs/ref/models/relations.txt b/docs/ref/models/relations.txt
index 9814485445..353504a58e 100644
--- a/docs/ref/models/relations.txt
+++ b/docs/ref/models/relations.txt
@@ -96,7 +96,7 @@ Related objects reference
parameter ``blog`` to ``create()``. Django figures out that the new
``Entry`` object's ``blog`` field should be set to ``b``.
- .. method:: remove(*objs)
+ .. method:: remove(*objs, bulk=True)
Removes the specified model objects from the related object set::
@@ -129,7 +129,10 @@ Related objects reference
:data:`~django.db.models.signals.post_save` signals and comes at the
expense of performance.
- .. method:: clear()
+ For many-to-many relationships, the ``bulk`` keyword argument doesn't
+ exist.
+
+ .. method:: clear(bulk=True)
Removes all objects from the related object set::
@@ -143,6 +146,9 @@ Related objects reference
:class:`~django.db.models.ForeignKey`\s where ``null=True`` and it also
accepts the ``bulk`` keyword argument.
+ For many-to-many relationships, the ``bulk`` keyword argument doesn't
+ exist.
+
.. method:: set(objs, bulk=True, clear=False)
Replace the set of related objects::
@@ -156,7 +162,11 @@ Related objects reference
If ``clear=True``, the ``clear()`` method is called instead and the
whole set is added at once.
- The ``bulk`` argument is passed on to :meth:`add`.
+ For :class:`~django.db.models.ForeignKey` objects, the ``bulk``
+ argument is passed on to :meth:`add` and :meth:`remove`.
+
+ For many-to-many relationships, the ``bulk`` keyword argument doesn't
+ exist.
Note that since ``set()`` is a compound operation, it is subject to
race conditions. For instance, new objects may be added to the database