summaryrefslogtreecommitdiff
path: root/docs/ref
diff options
context:
space:
mode:
authoracrefoot <acrefoot@dropbox.com>2015-08-20 22:38:58 -0700
committerTim Graham <timograham@gmail.com>2016-03-02 14:29:09 -0500
commit04240b23658f8935bbfebacccc23b5e47a1d6c22 (patch)
treef420c8d19fd94bd5317be22366e911d8064b97c8 /docs/ref
parent60633ef3dec8421706c610d8238af2cd679fc915 (diff)
Refs #19527 -- Allowed QuerySet.bulk_create() to set the primary key of its objects.
PostgreSQL support only. Thanks Vladislav Manchev and alesasnouski for working on the patch.
Diffstat (limited to 'docs/ref')
-rw-r--r--docs/ref/models/querysets.txt8
1 files changed, 7 insertions, 1 deletions
diff --git a/docs/ref/models/querysets.txt b/docs/ref/models/querysets.txt
index f626391dec..8781c4cdd4 100644
--- a/docs/ref/models/querysets.txt
+++ b/docs/ref/models/querysets.txt
@@ -1794,13 +1794,19 @@ This has a number of caveats though:
``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.
+ does not retrieve and set the primary key attribute, as ``save()`` does,
+ unless the database backend supports it (currently PostgreSQL).
* It does not work with many-to-many relationships.
.. versionchanged:: 1.9
Support for using ``bulk_create()`` with proxy models was added.
+.. versionchanged:: 1.0
+
+ Support for setting primary keys on objects created using ``bulk_create()``
+ when using PostgreSQL was added.
+
The ``batch_size`` parameter controls how many objects are created in single
query. The default is to create all objects in one batch, except for SQLite
where the default is such that at most 999 variables per query are used.