Add no_key parameter to select_for_update queryset method (#594) (#595)

Co-authored-by: Stevan Milic <stevan.milic@tradecore.com>
This commit is contained in:
Stevan Milic
2021-04-16 18:42:02 +02:00
committed by GitHub
parent 488d17b65c
commit 4c90b5098f
4 changed files with 4 additions and 1 deletions

View File

@@ -23,6 +23,7 @@ class BaseDatabaseFeatures:
has_select_for_update_nowait: bool = ...
has_select_for_update_skip_locked: bool = ...
has_select_for_update_of: bool = ...
has_select_for_no_key_update: bool = ...
select_for_update_of_column: bool = ...
test_db_allows_multiple_connections: bool = ...
supports_unspecified_pk: bool = ...

View File

@@ -14,6 +14,7 @@ class DatabaseFeatures(BaseDatabaseFeatures):
has_select_for_update_nowait: bool = ...
has_select_for_update_of: bool = ...
has_select_for_update_skip_locked: bool = ...
has_select_for_no_key_update: bool = ...
can_release_savepoints: bool = ...
supports_tablespaces: bool = ...
supports_transactions: bool = ...

View File

@@ -96,7 +96,7 @@ class _BaseQuerySet(Generic[_T], Sized):
def union(self: _QS, *other_qs: Any, all: bool = ...) -> _QS: ...
def intersection(self: _QS, *other_qs: Any) -> _QS: ...
def difference(self: _QS, *other_qs: Any) -> _QS: ...
def select_for_update(self: _QS, nowait: bool = ..., skip_locked: bool = ..., of: Sequence[str] = ...) -> _QS: ...
def select_for_update(self: _QS, nowait: bool = ..., skip_locked: bool = ..., of: Sequence[str] = ..., no_key: bool = ...) -> _QS: ...
def select_related(self: _QS, *fields: Any) -> _QS: ...
def prefetch_related(self: _QS, *lookups: Any) -> _QS: ...
# TODO: return type

View File

@@ -55,6 +55,7 @@ class Query:
select_for_update_nowait: bool = ...
select_for_update_skip_locked: bool = ...
select_for_update_of: Tuple = ...
select_for_no_key_update: bool = ...
select_related: Union[Dict[str, Any], bool] = ...
max_depth: int = ...
values_select: Tuple = ...