mirror of
https://github.com/django/django.git
synced 2025-10-29 08:36:09 +00:00
Fixed #30375 -- Added FOR NO KEY UPDATE support to QuerySet.select_for_update() on PostgreSQL.
This commit is contained in:
committed by
Mariusz Felisiak
parent
0e893248b2
commit
a4e6030904
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user