summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
Diffstat (limited to 'docs')
-rw-r--r--docs/ref/models/relations.txt23
-rw-r--r--docs/releases/3.1.txt4
2 files changed, 24 insertions, 3 deletions
diff --git a/docs/ref/models/relations.txt b/docs/ref/models/relations.txt
index d50e3891dc..2560a8e81c 100644
--- a/docs/ref/models/relations.txt
+++ b/docs/ref/models/relations.txt
@@ -71,7 +71,13 @@ Related objects reference
Use the ``through_defaults`` argument to specify values for the new
:ref:`intermediate model <intermediary-manytomany>` instance(s), if
- needed.
+ needed. You can use callables as values in the ``through_defaults``
+ dictionary and they will be evaluated once before creating any
+ intermediate instance(s).
+
+ .. versionchanged:: 3.1
+
+ ``through_defaults`` values can now be callables.
.. method:: create(through_defaults=None, **kwargs)
@@ -105,7 +111,12 @@ Related objects reference
Use the ``through_defaults`` argument to specify values for the new
:ref:`intermediate model <intermediary-manytomany>` instance, if
- needed.
+ needed. You can use callables as values in the ``through_defaults``
+ dictionary.
+
+ .. versionchanged:: 3.1
+
+ ``through_defaults`` values can now be callables.
.. method:: remove(*objs, bulk=True)
@@ -193,7 +204,13 @@ Related objects reference
Use the ``through_defaults`` argument to specify values for the new
:ref:`intermediate model <intermediary-manytomany>` instance(s), if
- needed.
+ needed. You can use callables as values in the ``through_defaults``
+ dictionary and they will be evaluated once before creating any
+ intermediate instance(s).
+
+ .. versionchanged:: 3.1
+
+ ``through_defaults`` values can now be callables.
.. note::
diff --git a/docs/releases/3.1.txt b/docs/releases/3.1.txt
index dc16b95f79..b4179883ab 100644
--- a/docs/releases/3.1.txt
+++ b/docs/releases/3.1.txt
@@ -209,6 +209,10 @@ Models
* :attr:`.CheckConstraint.check` now supports boolean expressions.
+* The :meth:`.RelatedManager.add`, :meth:`~.RelatedManager.create`, and
+ :meth:`~.RelatedManager.set` methods now accept callables as values in the
+ ``through_defaults`` argument.
+
Pagination
~~~~~~~~~~