mirror of
https://github.com/davidhalter/django-stubs.git
synced 2025-12-10 22:11:54 +08:00
Provide a more specific signature for django.core.checks.register (#509)
This also corrects the fact that "run_checks" only returns a concatenated list
of all registered check results, which may only contain CheckMessage:
302caa40e4/django/core/checks/registry.py (L60)
This commit is contained in:
@@ -15,17 +15,19 @@ class Tags:
|
||||
translation: str = ...
|
||||
urls: str = ...
|
||||
|
||||
_CheckCallable = Callable[..., List[CheckMessage]]
|
||||
|
||||
class CheckRegistry:
|
||||
registered_checks: Set[Callable] = ...
|
||||
deployment_checks: Set[Callable] = ...
|
||||
def __init__(self) -> None: ...
|
||||
def register(self, check: Optional[Union[Callable, str]] = ..., *tags: Any, **kwargs: Any) -> Callable: ...
|
||||
def register(self, check: Optional[Union[_CheckCallable, str]] = ..., *tags: str, **kwargs: Any) -> Callable: ...
|
||||
def run_checks(
|
||||
self,
|
||||
app_configs: Optional[List[AppConfig]] = ...,
|
||||
tags: Optional[List[str]] = ...,
|
||||
include_deployment_checks: bool = ...,
|
||||
) -> Union[List[CheckMessage], List[int], List[str]]: ...
|
||||
) -> List[CheckMessage]: ...
|
||||
def tag_exists(self, tag: str, include_deployment_checks: bool = ...) -> bool: ...
|
||||
def tags_available(self, deployment_checks: bool = ...) -> Set[str]: ...
|
||||
def get_checks(self, include_deployment_checks: bool = ...) -> List[Callable]: ...
|
||||
|
||||
Reference in New Issue
Block a user