mirror of
https://github.com/django/django.git
synced 2025-06-05 03:29:12 +00:00
[3.2.x] Refs #31003 -- Moved note about return value of QuerySet.bulk_create() to the first paragraph.
Backport of cac9ec73db35a6d38d33f271f4724da486c60e9f from main.
This commit is contained in:
parent
601ceddf79
commit
3eb72ad30f
@ -2173,9 +2173,9 @@ exists in the database, an :exc:`~django.db.IntegrityError` is raised.
|
|||||||
|
|
||||||
This method inserts the provided list of objects into the database in an
|
This method inserts the provided list of objects into the database in an
|
||||||
efficient manner (generally only 1 query, no matter how many objects there
|
efficient manner (generally only 1 query, no matter how many objects there
|
||||||
are)::
|
are), and returns created objects as a list, in the same order as provided::
|
||||||
|
|
||||||
>>> Entry.objects.bulk_create([
|
>>> objs = Entry.objects.bulk_create([
|
||||||
... Entry(headline='This is a test'),
|
... Entry(headline='This is a test'),
|
||||||
... Entry(headline='This is only a test'),
|
... Entry(headline='This is only a test'),
|
||||||
... ])
|
... ])
|
||||||
@ -2226,8 +2226,6 @@ normally supports it).
|
|||||||
.. _MySQL documentation: https://dev.mysql.com/doc/refman/en/sql-mode.html#ignore-strict-comparison
|
.. _MySQL documentation: https://dev.mysql.com/doc/refman/en/sql-mode.html#ignore-strict-comparison
|
||||||
.. _MariaDB documentation: https://mariadb.com/kb/en/ignore/
|
.. _MariaDB documentation: https://mariadb.com/kb/en/ignore/
|
||||||
|
|
||||||
Returns ``objs`` as cast to a list, in the same order as provided.
|
|
||||||
|
|
||||||
.. versionchanged:: 3.1
|
.. versionchanged:: 3.1
|
||||||
|
|
||||||
Support for the fetching primary key attributes on MariaDB 10.5+ was added.
|
Support for the fetching primary key attributes on MariaDB 10.5+ was added.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user