summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorAdam Johnson <me@adamj.eu>2020-03-25 08:58:21 +0000
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2020-03-31 07:25:50 +0200
commit93ed71e05802a47774b52503cdc3442686d686c1 (patch)
treef5eec1a66125ca1b141137c5f8f8bf3549c73619 /docs
parentc06d7c92392c799d5a17f2620f8e280e119409bf (diff)
Fixed #31403 -- Added support for returning fields from INSERT statements on MariaDB 10.5+.
Diffstat (limited to 'docs')
-rw-r--r--docs/ref/models/querysets.txt10
-rw-r--r--docs/releases/3.1.txt3
2 files changed, 10 insertions, 3 deletions
diff --git a/docs/ref/models/querysets.txt b/docs/ref/models/querysets.txt
index 9647b1a8ff..c51c4dd43a 100644
--- a/docs/ref/models/querysets.txt
+++ b/docs/ref/models/querysets.txt
@@ -2078,9 +2078,9 @@ This has a number of caveats though:
* The model's ``save()`` method will not be called, and the ``pre_save`` and
``post_save`` signals will not be sent.
* It does not work with child models in a multi-table inheritance scenario.
-* If the model's primary key is an :class:`~django.db.models.AutoField` it
- does not retrieve and set the primary key attribute, as ``save()`` does,
- unless the database backend supports it (currently PostgreSQL).
+* If the model's primary key is an :class:`~django.db.models.AutoField`, the
+ primary key attribute can only be retrieved on certain databases (currently
+ PostgreSQL and MariaDB 10.5+). On other databases, it will not be set.
* It does not work with many-to-many relationships.
* It casts ``objs`` to a list, which fully evaluates ``objs`` if it's a
generator. The cast allows inspecting all objects so that any objects with a
@@ -2110,6 +2110,10 @@ normally supports it).
Returns ``objs`` as cast to a list, in the same order as provided.
+.. versionchanged:: 3.1
+
+ Support for the fetching primary key attributes on MariaDB 10.5+ was added.
+
``bulk_update()``
~~~~~~~~~~~~~~~~~
diff --git a/docs/releases/3.1.txt b/docs/releases/3.1.txt
index ecd70feb2e..d133731c25 100644
--- a/docs/releases/3.1.txt
+++ b/docs/releases/3.1.txt
@@ -344,6 +344,9 @@ Models
* The new :class:`~django.db.models.F` expression ``bitxor()`` method allows
:ref:`bitwise XOR operation <using-f-expressions-in-filters>`.
+* :meth:`.QuerySet.bulk_create` now sets the primary key on objects when using
+ MariaDB 10.5+.
+
Pagination
~~~~~~~~~~