mirror of
https://github.com/davidhalter/django-stubs.git
synced 2025-12-08 13:04:47 +08:00
black reformat, some fixes
This commit is contained in:
@@ -10,7 +10,9 @@ class DummyCache(BaseCache):
|
||||
def __init__(self, host: str, *args: Any, **kwargs: Any) -> None: ...
|
||||
def add(self, key: str, value: str, timeout: Any = ..., version: None = ...) -> bool: ...
|
||||
def get(self, key: str, default: Optional[str] = ..., version: Optional[int] = ...) -> Optional[str]: ...
|
||||
def set(self, key: str, value: Union[Dict[str, Any], int, str], timeout: Any = ..., version: Optional[str] = ...) -> None: ...
|
||||
def set(
|
||||
self, key: str, value: Union[Dict[str, Any], int, str], timeout: Any = ..., version: Optional[str] = ...
|
||||
) -> None: ...
|
||||
def touch(self, key: str, timeout: Any = ..., version: None = ...) -> bool: ...
|
||||
def delete(self, key: str, version: None = ...) -> None: ...
|
||||
def has_key(self, key: str, version: None = ...) -> bool: ...
|
||||
|
||||
@@ -12,7 +12,9 @@ class FileBasedCache(BaseCache):
|
||||
def add(
|
||||
self, key: str, value: Union[Dict[str, int], bytes, int, str], timeout: Any = ..., version: Optional[int] = ...
|
||||
) -> bool: ...
|
||||
def get(self, key: str, default: Optional[Union[int, str]] = ..., version: Optional[int] = ...) -> Optional[str]: ...
|
||||
def get(
|
||||
self, key: str, default: Optional[Union[int, str]] = ..., version: Optional[int] = ...
|
||||
) -> Optional[str]: ...
|
||||
def set(self, key: str, value: Any, timeout: Any = ..., version: Optional[int] = ...) -> None: ...
|
||||
def touch(self, key: str, timeout: Any = ..., version: None = ...) -> bool: ...
|
||||
def delete(self, key: str, version: Optional[int] = ...) -> None: ...
|
||||
|
||||
@@ -15,7 +15,9 @@ class LocMemCache(BaseCache):
|
||||
timeout: Any = ...,
|
||||
version: Optional[int] = ...,
|
||||
) -> Any: ...
|
||||
def get(self, key: Union[int, str], default: Optional[Union[int, str]] = ..., version: Optional[int] = ...) -> Any: ...
|
||||
def get(
|
||||
self, key: Union[int, str], default: Optional[Union[int, str]] = ..., version: Optional[int] = ...
|
||||
) -> Any: ...
|
||||
def set(self, key: Union[int, str], value: Any, timeout: Any = ..., version: Optional[int] = ...) -> None: ...
|
||||
def touch(self, key: str, timeout: Any = ..., version: None = ...) -> Any: ...
|
||||
def incr(self, key: Union[int, str], delta: int = ..., version: Optional[int] = ...) -> int: ...
|
||||
|
||||
@@ -12,7 +12,9 @@ class CheckMessage:
|
||||
hint: Any = ...
|
||||
obj: Any = ...
|
||||
id: Any = ...
|
||||
def __init__(self, level: int, msg: str, hint: Optional[str] = ..., obj: Any = ..., id: Optional[str] = ...) -> None: ...
|
||||
def __init__(
|
||||
self, level: int, msg: str, hint: Optional[str] = ..., obj: Any = ..., id: Optional[str] = ...
|
||||
) -> None: ...
|
||||
def __eq__(self, other: Union[CheckMessage, str]) -> bool: ...
|
||||
def is_serious(self, level: int = ...) -> bool: ...
|
||||
def is_silenced(self) -> bool: ...
|
||||
|
||||
@@ -20,7 +20,10 @@ class CheckRegistry:
|
||||
def __init__(self) -> None: ...
|
||||
def register(self, check: Optional[Union[Callable, str]] = ..., *tags: Any, **kwargs: Any) -> Callable: ...
|
||||
def run_checks(
|
||||
self, app_configs: Optional[List[AppConfig]] = ..., tags: Optional[List[str]] = ..., include_deployment_checks: bool = ...
|
||||
self,
|
||||
app_configs: Optional[List[AppConfig]] = ...,
|
||||
tags: Optional[List[str]] = ...,
|
||||
include_deployment_checks: bool = ...,
|
||||
) -> Union[List[CheckMessage], List[int], List[str]]: ...
|
||||
def tag_exists(self, tag: str, include_deployment_checks: bool = ...) -> bool: ...
|
||||
def tags_available(self, deployment_checks: bool = ...) -> Set[str]: ...
|
||||
|
||||
@@ -42,7 +42,9 @@ class ValidationError(Exception):
|
||||
str,
|
||||
],
|
||||
code: Optional[str] = ...,
|
||||
params: Optional[Union[Dict[str, Union[Tuple[str], Type[Model], Model, str]], Dict[str, Union[int, str]]]] = ...,
|
||||
params: Optional[
|
||||
Union[Dict[str, Union[Tuple[str], Type[Model], Model, str]], Dict[str, Union[int, str]]]
|
||||
] = ...,
|
||||
) -> None: ...
|
||||
@property
|
||||
def message_dict(self) -> Dict[str, List[str]]: ...
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
from typing import Any, Optional
|
||||
|
||||
def file_move_safe(old_file_name: str, new_file_name: str, chunk_size: int = ..., allow_overwrite: bool = ...) -> None: ...
|
||||
def file_move_safe(
|
||||
old_file_name: str, new_file_name: str, chunk_size: int = ..., allow_overwrite: bool = ...
|
||||
) -> None: ...
|
||||
|
||||
@@ -25,7 +25,12 @@ class TemporaryUploadedFile(UploadedFile):
|
||||
file: tempfile._TemporaryFileWrapper
|
||||
mode: str
|
||||
def __init__(
|
||||
self, name: str, content_type: str, size: int, charset: Optional[str], content_type_extra: Optional[Dict[Any, Any]] = ...
|
||||
self,
|
||||
name: str,
|
||||
content_type: str,
|
||||
size: int,
|
||||
charset: Optional[str],
|
||||
content_type_extra: Optional[Dict[Any, Any]] = ...,
|
||||
) -> None: ...
|
||||
def temporary_file_path(self) -> str: ...
|
||||
def close(self) -> None: ...
|
||||
|
||||
@@ -40,7 +40,9 @@ class OutputWrapper(TextIOBase):
|
||||
def style_func(self, style_func: Any): ...
|
||||
style_func: Any = ...
|
||||
ending: str = ...
|
||||
def __init__(self, out: Union[StringIO, TextIOWrapper], style_func: Optional[Callable] = ..., ending: str = ...) -> None: ...
|
||||
def __init__(
|
||||
self, out: Union[StringIO, TextIOWrapper], style_func: Optional[Callable] = ..., ending: str = ...
|
||||
) -> None: ...
|
||||
def __getattr__(self, name: str) -> Callable: ...
|
||||
def isatty(self) -> bool: ...
|
||||
def write(self, msg: str, style_func: Optional[Callable] = ..., ending: Optional[str] = ...) -> None: ...
|
||||
@@ -55,7 +57,9 @@ class BaseCommand:
|
||||
stdout: django.core.management.base.OutputWrapper = ...
|
||||
stderr: django.core.management.base.OutputWrapper = ...
|
||||
style: django.core.management.color.Style = ...
|
||||
def __init__(self, stdout: Optional[StringIO] = ..., stderr: Optional[StringIO] = ..., no_color: bool = ...) -> None: ...
|
||||
def __init__(
|
||||
self, stdout: Optional[StringIO] = ..., stderr: Optional[StringIO] = ..., no_color: bool = ...
|
||||
) -> None: ...
|
||||
def get_version(self) -> str: ...
|
||||
def create_parser(self, prog_name: str, subcommand: str) -> CommandParser: ...
|
||||
def add_arguments(self, parser: CommandParser) -> None: ...
|
||||
|
||||
@@ -14,5 +14,7 @@ class Command(BaseCommand):
|
||||
interactive: Any = ...
|
||||
def handle(self, *args: Any, **options: Any) -> None: ...
|
||||
start: Any = ...
|
||||
def migration_progress_callback(self, action: str, migration: Optional[Migration] = ..., fake: bool = ...) -> None: ...
|
||||
def migration_progress_callback(
|
||||
self, action: str, migration: Optional[Migration] = ..., fake: bool = ...
|
||||
) -> None: ...
|
||||
def sync_apps(self, connection: DatabaseWrapper, app_labels: Set[str]) -> None: ...
|
||||
|
||||
@@ -4,7 +4,11 @@ from django.core.management.color import Style
|
||||
from django.db.backends.sqlite3.base import DatabaseWrapper
|
||||
|
||||
def sql_flush(
|
||||
style: Style, connection: DatabaseWrapper, only_django: bool = ..., reset_sequences: bool = ..., allow_cascade: bool = ...
|
||||
style: Style,
|
||||
connection: DatabaseWrapper,
|
||||
only_django: bool = ...,
|
||||
reset_sequences: bool = ...,
|
||||
allow_cascade: bool = ...,
|
||||
) -> List[str]: ...
|
||||
def emit_pre_migrate_signal(verbosity: int, interactive: bool, db: str, **kwargs: Any) -> None: ...
|
||||
def emit_post_migrate_signal(verbosity: int, interactive: bool, db: str, **kwargs: Any) -> None: ...
|
||||
|
||||
@@ -36,7 +36,10 @@ class Page(collections.abc.Sequence):
|
||||
number: int = ...
|
||||
paginator: django.core.paginator.Paginator = ...
|
||||
def __init__(
|
||||
self, object_list: Union[List[Dict[str, str]], List[Model], List[int], QuerySet, str], number: int, paginator: Paginator
|
||||
self,
|
||||
object_list: Union[List[Dict[str, str]], List[Model], List[int], QuerySet, str],
|
||||
number: int,
|
||||
paginator: Paginator,
|
||||
) -> None: ...
|
||||
def __len__(self) -> int: ...
|
||||
def __getitem__(self, index: Union[int, str]) -> Union[Model, str]: ...
|
||||
|
||||
@@ -77,7 +77,9 @@ class DeserializedObject:
|
||||
def save(self, save_m2m: bool = ..., using: Optional[str] = ..., **kwargs: Any) -> None: ...
|
||||
|
||||
def build_instance(Model: Type[Model], data: Dict[str, Optional[Union[date, int, str, UUID]]], db: str) -> Model: ...
|
||||
def deserialize_m2m_values(field: ManyToManyField, field_value: Union[List[List[str]], List[int]], using: str) -> List[int]: ...
|
||||
def deserialize_m2m_values(
|
||||
field: ManyToManyField, field_value: Union[List[List[str]], List[int]], using: str
|
||||
) -> List[int]: ...
|
||||
def deserialize_fk_value(
|
||||
field: ForeignKey, field_value: Optional[Union[List[str], Tuple[str], int, str]], using: str
|
||||
) -> Optional[Union[int, str, UUID]]: ...
|
||||
|
||||
@@ -50,7 +50,9 @@ class EmailValidator:
|
||||
domain_regex: Any = ...
|
||||
literal_regex: Any = ...
|
||||
domain_whitelist: Any = ...
|
||||
def __init__(self, message: Optional[str] = ..., code: Optional[str] = ..., whitelist: Optional[List[str]] = ...) -> None: ...
|
||||
def __init__(
|
||||
self, message: Optional[str] = ..., code: Optional[str] = ..., whitelist: Optional[List[str]] = ...
|
||||
) -> None: ...
|
||||
def __call__(self, value: Optional[str]) -> None: ...
|
||||
def validate_domain_part(self, domain_part: str) -> bool: ...
|
||||
def __eq__(self, other: EmailValidator) -> bool: ...
|
||||
@@ -68,7 +70,9 @@ def validate_ipv46_address(value: str) -> None: ...
|
||||
ip_address_validator_map: Any
|
||||
|
||||
def ip_address_validators(protocol: str, unpack_ipv4: bool) -> Any: ...
|
||||
def int_list_validator(sep: str = ..., message: None = ..., code: str = ..., allow_negative: bool = ...) -> RegexValidator: ...
|
||||
def int_list_validator(
|
||||
sep: str = ..., message: None = ..., code: str = ..., allow_negative: bool = ...
|
||||
) -> RegexValidator: ...
|
||||
|
||||
validate_comma_separated_integer_list: Any
|
||||
|
||||
@@ -76,7 +80,9 @@ class BaseValidator:
|
||||
message: Any = ...
|
||||
code: str = ...
|
||||
limit_value: bool = ...
|
||||
def __init__(self, limit_value: Optional[Union[datetime, Decimal, float, str]], message: Optional[str] = ...) -> None: ...
|
||||
def __init__(
|
||||
self, limit_value: Optional[Union[datetime, Decimal, float, str]], message: Optional[str] = ...
|
||||
) -> None: ...
|
||||
def __call__(self, value: Union[bytes, datetime, Decimal, float, str]) -> None: ...
|
||||
def __eq__(self, other: BaseValidator) -> bool: ...
|
||||
def compare(self, a: bool, b: bool) -> bool: ...
|
||||
|
||||
Reference in New Issue
Block a user