summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorThomas Chaumeny <thomas.chaumeny.ext@gitguardian.com>2023-07-07 13:08:17 +0200
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2023-07-10 13:17:28 +0200
commit89c7454dbdae3e0df6d96aa6132205d05e4a9b3d (patch)
treee98327998df0f061c6fe2a0a0002b6b60b310260 /docs
parentb7a17b0ea0a2061bae752a3a2292007d41825814 (diff)
Fixed #34698 -- Made QuerySet.bulk_create() retrieve primary keys when updating conflicts.
Diffstat (limited to 'docs')
-rw-r--r--docs/ref/models/querysets.txt10
-rw-r--r--docs/releases/5.0.txt4
2 files changed, 11 insertions, 3 deletions
diff --git a/docs/ref/models/querysets.txt b/docs/ref/models/querysets.txt
index a754953264..fd6bb39ff8 100644
--- a/docs/ref/models/querysets.txt
+++ b/docs/ref/models/querysets.txt
@@ -2411,9 +2411,13 @@ On databases that support it (all except Oracle and SQLite < 3.24), setting the
SQLite, in addition to ``update_fields``, a list of ``unique_fields`` that may
be in conflict must be provided.
-Enabling the ``ignore_conflicts`` or ``update_conflicts`` parameter disable
-setting the primary key on each model instance (if the database normally
-support it).
+Enabling the ``ignore_conflicts`` parameter disables setting the primary key on
+each model instance (if the database normally supports it).
+
+.. versionchanged:: 5.0
+
+ In older versions, enabling the ``update_conflicts`` parameter prevented
+ setting the primary key on each model instance.
.. warning::
diff --git a/docs/releases/5.0.txt b/docs/releases/5.0.txt
index 0ad0835c29..e4c1eac1d9 100644
--- a/docs/releases/5.0.txt
+++ b/docs/releases/5.0.txt
@@ -357,6 +357,10 @@ Models
:meth:`.Model.save` now allows specifying a tuple of parent classes that must
be forced to be inserted.
+* :meth:`.QuerySet.bulk_create` and :meth:`.QuerySet.abulk_create` methods now
+ set the primary key on each model instance when the ``update_conflicts``
+ parameter is enabled (if the database supports it).
+
Pagination
~~~~~~~~~~