mirror of
https://github.com/django/django.git
synced 2025-09-26 12:09:19 +00:00
Fixed #28010 -- Added FOR UPDATE OF support to QuerySet.select_for_update().
This commit is contained in:
parent
2d18c60fbb
commit
b9f7dce84b
12 changed files with 206 additions and 23 deletions
|
@ -839,7 +839,7 @@ class QuerySet:
|
|||
return self
|
||||
return self._combinator_query('difference', *other_qs)
|
||||
|
||||
def select_for_update(self, nowait=False, skip_locked=False):
|
||||
def select_for_update(self, nowait=False, skip_locked=False, of=()):
|
||||
"""
|
||||
Return a new QuerySet instance that will select objects with a
|
||||
FOR UPDATE lock.
|
||||
|
@ -851,6 +851,7 @@ class QuerySet:
|
|||
obj.query.select_for_update = True
|
||||
obj.query.select_for_update_nowait = nowait
|
||||
obj.query.select_for_update_skip_locked = skip_locked
|
||||
obj.query.select_for_update_of = of
|
||||
return obj
|
||||
|
||||
def select_related(self, *fields):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue