diff options
| author | Tim Graham <timograham@gmail.com> | 2018-02-14 09:57:31 -0500 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2018-02-15 13:41:33 -0500 |
| commit | 4b8e433e1cacd7405d6ae0a88d1776adc0068f10 (patch) | |
| tree | 0556a61829479755674b65af055c9176c45b3c66 /docs | |
| parent | fd18345e10b9e5c9713c606509feaf18e57178e2 (diff) | |
[2.0.x] Fixed #29126 -- Doc'd the behavior of QuerySet.update_or_create() with manually specified pks.
Backport of e917ea6bec45d7f789ca96a13be15df9521963e1 from master
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/ref/models/querysets.txt | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/docs/ref/models/querysets.txt b/docs/ref/models/querysets.txt index 2259874435..13cc70be9f 100644 --- a/docs/ref/models/querysets.txt +++ b/docs/ref/models/querysets.txt @@ -1974,6 +1974,10 @@ As described above in :meth:`get_or_create`, this method is prone to a race-condition which can result in multiple rows being inserted simultaneously if uniqueness is not enforced at the database level. +Like :meth:`get_or_create` and :meth:`create`, if you're using manually +specified primary keys and an object needs to be created but the key already +exists in the database, an :exc:`~django.db.IntegrityError` is raised. + .. versionchanged:: 1.11 Added support for callable values in ``defaults``. |
