diff --git a/django-stubs/core/management/base.pyi b/django-stubs/core/management/base.pyi index 5ec61d9..3e43642 100644 --- a/django-stubs/core/management/base.pyi +++ b/django-stubs/core/management/base.pyi @@ -39,7 +39,7 @@ class BaseCommand: help: str = ... output_transaction: bool = ... requires_migrations_checks: bool = ... - requires_system_checks: Union[bool, List[Tags], Tuple[Tags, ...], str] = ... + requires_system_checks: Union[bool, List[Tags], Tuple[Tags, ...], str] = ... base_stealth_options: Tuple[str, ...] = ... stealth_options: Tuple[str, ...] = ... stdout: OutputWrapper = ... diff --git a/django-stubs/db/models/query.pyi b/django-stubs/db/models/query.pyi index 9a15325..6d476c2 100644 --- a/django-stubs/db/models/query.pyi +++ b/django-stubs/db/models/query.pyi @@ -96,7 +96,9 @@ 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] = ..., no_key: bool = ...) -> _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/utils/decorators.pyi b/django-stubs/utils/decorators.pyi index 704213d..e58530a 100644 --- a/django-stubs/utils/decorators.pyi +++ b/django-stubs/utils/decorators.pyi @@ -6,11 +6,14 @@ from django.views.generic.base import View from django.utils.functional import classproperty as classproperty _T = TypeVar("_T", bound=Union[View, Callable]) # Any callable +_CallableType = TypeVar("_CallableType", bound=Callable) class classonlymethod(classmethod): ... def method_decorator(decorator: Union[Callable, Iterable[Callable]], name: str = ...) -> Callable[[_T], _T]: ... def decorator_from_middleware_with_args(middleware_class: type) -> Callable: ... def decorator_from_middleware(middleware_class: type) -> Callable: ... -def available_attrs(fn: Callable): ... def make_middleware_decorator(middleware_class: Type[MiddlewareMixin]) -> Callable: ... +def sync_and_async_middleware(func: _CallableType) -> _CallableType: ... +def sync_only_middleware(func: _CallableType) -> _CallableType: ... +def async_only_middleware(func: _CallableType) -> _CallableType: ...