mirror of
https://github.com/django/django.git
synced 2025-11-07 07:15:35 +00:00
Fixed #34280 -- Allowed specifying different field values for create operation in QuerySet.update_or_create().
This commit is contained in:
committed by
Mariusz Felisiak
parent
ecafcaf634
commit
c5808470aa
@@ -178,7 +178,9 @@ Migrations
|
||||
Models
|
||||
~~~~~~
|
||||
|
||||
* ...
|
||||
* The new ``create_defaults`` argument of :meth:`.QuerySet.update_or_create`
|
||||
and :meth:`.QuerySet.aupdate_or_create` methods allows specifying a different
|
||||
field values for the create operation.
|
||||
|
||||
Requests and Responses
|
||||
~~~~~~~~~~~~~~~~~~~~~~
|
||||
@@ -238,6 +240,14 @@ backends.
|
||||
|
||||
* ...
|
||||
|
||||
Using ``create_defaults__exact`` may now be required with ``QuerySet.update_or_create()``
|
||||
-----------------------------------------------------------------------------------------
|
||||
|
||||
:meth:`.QuerySet.update_or_create` now supports the parameter
|
||||
``create_defaults``. As a consequence, any models that have a field named
|
||||
``create_defaults`` that are used with an ``update_or_create()`` should specify
|
||||
the field in the lookup with ``create_defaults__exact``.
|
||||
|
||||
Miscellaneous
|
||||
-------------
|
||||
|
||||
|
||||
Reference in New Issue
Block a user