summaryrefslogtreecommitdiff
path: root/django/db/models/query.py
diff options
context:
space:
mode:
authorManuel Weitzman <manuelweitzman@gmail.com>2020-05-10 12:25:06 -0400
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2020-05-21 10:51:10 +0200
commita4e6030904df63b3f10aa0729b86dc6942b0458e (patch)
tree7a84def5f8bd0e0376a471fa238f74f429e25478 /django/db/models/query.py
parent0e893248b28e30bf562d29e6d5745ffad4b1a1eb (diff)
Fixed #30375 -- Added FOR NO KEY UPDATE support to QuerySet.select_for_update() on PostgreSQL.
Diffstat (limited to 'django/db/models/query.py')
-rw-r--r--django/db/models/query.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/django/db/models/query.py b/django/db/models/query.py
index 5c70229263..07d6ffd4ca 100644
--- a/django/db/models/query.py
+++ b/django/db/models/query.py
@@ -1018,7 +1018,7 @@ class QuerySet:
return self
return self._combinator_query('difference', *other_qs)
- def select_for_update(self, nowait=False, skip_locked=False, of=()):
+ def select_for_update(self, nowait=False, skip_locked=False, of=(), no_key=False):
"""
Return a new QuerySet instance that will select objects with a
FOR UPDATE lock.
@@ -1031,6 +1031,7 @@ class QuerySet:
obj.query.select_for_update_nowait = nowait
obj.query.select_for_update_skip_locked = skip_locked
obj.query.select_for_update_of = of
+ obj.query.select_for_no_key_update = no_key
return obj
def select_related(self, *fields):