diff options
| author | Dmitry Shachnev <mitya57@gmail.com> | 2025-03-16 20:50:45 +0300 |
|---|---|---|
| committer | Sarah Boyce <42296566+sarahboyce@users.noreply.github.com> | 2025-03-26 09:55:09 +0100 |
| commit | 77b4ecbd53635b94d3685d16af9e8b2f96cf952c (patch) | |
| tree | 9d7ea315f3d6c951d6be32e8bb36b3ffcc2fcc1b /docs | |
| parent | c75fbe843079ca249d7015926490dd21107e63a4 (diff) | |
Fixed #36260 -- Made bulk_create() work with DB-generated primary keys.
Co-authored-by: Simon Charette <charette.s@gmail.com>
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/ref/models/querysets.txt | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/docs/ref/models/querysets.txt b/docs/ref/models/querysets.txt index 91ce0bac69..e16d6668ee 100644 --- a/docs/ref/models/querysets.txt +++ b/docs/ref/models/querysets.txt @@ -2427,10 +2427,11 @@ 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` and - ``ignore_conflicts`` is False, the primary key attribute can only be - retrieved on certain databases (currently PostgreSQL, MariaDB, and SQLite - 3.35+). On other databases, it will not be set. +* If the model's primary key is an :class:`~django.db.models.AutoField` or has + a :attr:`~django.db.models.Field.db_default` value, and ``ignore_conflicts`` + is ``False``, the primary key attribute can only be retrieved on certain + databases (currently PostgreSQL, MariaDB, and SQLite 3.35+). 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 |
