From 4c90b5098f27fcc862c19dcf6dd6666920935c92 Mon Sep 17 00:00:00 2001 From: Stevan Milic Date: Fri, 16 Apr 2021 18:42:02 +0200 Subject: [PATCH] Add `no_key` parameter to `select_for_update` queryset method (#594) (#595) Co-authored-by: Stevan Milic --- django-stubs/db/backends/base/features.pyi | 1 + django-stubs/db/backends/postgresql/features.pyi | 1 + django-stubs/db/models/query.pyi | 2 +- django-stubs/db/models/sql/query.pyi | 1 + 4 files changed, 4 insertions(+), 1 deletion(-) diff --git a/django-stubs/db/backends/base/features.pyi b/django-stubs/db/backends/base/features.pyi index 8d24f2a..88032c2 100644 --- a/django-stubs/db/backends/base/features.pyi +++ b/django-stubs/db/backends/base/features.pyi @@ -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 = ... diff --git a/django-stubs/db/backends/postgresql/features.pyi b/django-stubs/db/backends/postgresql/features.pyi index bb34529..5604588 100644 --- a/django-stubs/db/backends/postgresql/features.pyi +++ b/django-stubs/db/backends/postgresql/features.pyi @@ -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 = ... diff --git a/django-stubs/db/models/query.pyi b/django-stubs/db/models/query.pyi index 901884d..9a15325 100644 --- a/django-stubs/db/models/query.pyi +++ b/django-stubs/db/models/query.pyi @@ -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 diff --git a/django-stubs/db/models/sql/query.pyi b/django-stubs/db/models/sql/query.pyi index 2ed5c65..2ac6e61 100644 --- a/django-stubs/db/models/sql/query.pyi +++ b/django-stubs/db/models/sql/query.pyi @@ -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 = ...