run black over stubs, add checking to travis

This commit is contained in:
Maxim Kurnikov
2018-12-03 18:52:44 +03:00
parent d5bc7d4ab2
commit cf6119bf9b
420 changed files with 2295 additions and 8384 deletions

View File

@@ -5,28 +5,17 @@ from django.core.cache.backends.base import BaseCache as BaseCache
DEFAULT_CACHE_ALIAS: str
class CacheHandler:
def __init__(self) -> None: ...
def __getitem__(self, alias: str) -> BaseCache: ...
def all(self): ...
class DefaultCacheProxy:
def __getattr__(
self, name: str
) -> Union[Callable, Dict[str, float], OrderedDict, int]: ...
def __getattr__(self, name: str) -> Union[Callable, Dict[str, float], OrderedDict, int]: ...
def __setattr__(self, name: str, value: Callable) -> None: ...
def __delattr__(self, name: Any): ...
def __contains__(self, key: str) -> bool: ...
def __eq__(self, other: Any): ...
cache: Any
caches: CacheHandler

View File

@@ -3,16 +3,13 @@ from typing import Any, Callable, Dict, List, Optional, Union
from django.core.exceptions import ImproperlyConfigured
class InvalidCacheBackendError(ImproperlyConfigured): ...
class CacheKeyWarning(RuntimeWarning): ...
DEFAULT_TIMEOUT: Any
MEMCACHE_MAX_KEY_LENGTH: int
def default_key_func(
key: Union[int, str], key_prefix: str, version: Union[int, str]
) -> str: ...
def default_key_func(key: Union[int, str], key_prefix: str, version: Union[int, str]) -> str: ...
def get_key_func(key_func: Optional[Union[Callable, str]]) -> Callable: ...
class BaseCache:
@@ -20,73 +17,31 @@ class BaseCache:
key_prefix: str = ...
version: int = ...
key_func: Callable = ...
def __init__(
self,
params: Dict[str, Optional[Union[Callable, Dict[str, int], int, str]]],
) -> None: ...
def __init__(self, params: Dict[str, Optional[Union[Callable, Dict[str, int], int, str]]]) -> None: ...
def get_backend_timeout(self, timeout: Any = ...) -> Optional[float]: ...
def make_key(
self, key: Union[int, str], version: Optional[Union[int, str]] = ...
) -> str: ...
def add(
self,
key: Any,
value: Any,
timeout: Any = ...,
version: Optional[Any] = ...,
) -> None: ...
def get(
self,
key: Any,
default: Optional[Any] = ...,
version: Optional[Any] = ...,
) -> None: ...
def set(
self,
key: Any,
value: Any,
timeout: Any = ...,
version: Optional[Any] = ...,
) -> None: ...
def touch(
self, key: Any, timeout: Any = ..., version: Optional[Any] = ...
) -> None: ...
def make_key(self, key: Union[int, str], version: Optional[Union[int, str]] = ...) -> str: ...
def add(self, key: Any, value: Any, timeout: Any = ..., version: Optional[Any] = ...) -> None: ...
def get(self, key: Any, default: Optional[Any] = ..., version: Optional[Any] = ...) -> None: ...
def set(self, key: Any, value: Any, timeout: Any = ..., version: Optional[Any] = ...) -> None: ...
def touch(self, key: Any, timeout: Any = ..., version: Optional[Any] = ...) -> None: ...
def delete(self, key: Any, version: Optional[Any] = ...) -> None: ...
def get_many(
self, keys: List[str], version: Optional[int] = ...
) -> Dict[str, Union[int, str]]: ...
def get_many(self, keys: List[str], version: Optional[int] = ...) -> Dict[str, Union[int, str]]: ...
def get_or_set(
self,
key: str,
default: Optional[Union[Callable, int, str]],
timeout: Any = ...,
version: Optional[int] = ...,
self, key: str, default: Optional[Union[Callable, int, str]], timeout: Any = ..., version: Optional[int] = ...
) -> Optional[Union[int, str]]: ...
def has_key(self, key: Any, version: Optional[Any] = ...): ...
def incr(
self, key: str, delta: int = ..., version: Optional[int] = ...
) -> int: ...
def decr(
self, key: str, delta: int = ..., version: Optional[int] = ...
) -> int: ...
def incr(self, key: str, delta: int = ..., version: Optional[int] = ...) -> int: ...
def decr(self, key: str, delta: int = ..., version: Optional[int] = ...) -> int: ...
def __contains__(self, key: str) -> bool: ...
def set_many(
self,
data: Union[
Dict[str, bytes], Dict[str, int], Dict[str, str], OrderedDict
],
data: Union[Dict[str, bytes], Dict[str, int], Dict[str, str], OrderedDict],
timeout: Any = ...,
version: Optional[Union[int, str]] = ...,
) -> List[Any]: ...
def delete_many(
self, keys: Union[Dict[str, str], List[str]], version: None = ...
) -> None: ...
def delete_many(self, keys: Union[Dict[str, str], List[str]], version: None = ...) -> None: ...
def clear(self) -> None: ...
def validate_key(self, key: str) -> None: ...
def incr_version(
self, key: str, delta: int = ..., version: Optional[int] = ...
) -> int: ...
def decr_version(
self, key: str, delta: int = ..., version: Optional[int] = ...
) -> int: ...
def incr_version(self, key: str, delta: int = ..., version: Optional[int] = ...) -> int: ...
def decr_version(self, key: str, delta: int = ..., version: Optional[int] = ...) -> int: ...
def close(self, **kwargs: Any) -> None: ...

View File

@@ -2,7 +2,6 @@ from typing import Any, Callable, Dict, Optional, Union
from django.core.cache.backends.base import BaseCache
class Options:
db_table: str = ...
app_label: str = ...
@@ -22,40 +21,19 @@ class BaseDatabaseCache(BaseCache):
key_prefix: str
version: int
cache_model_class: Any = ...
def __init__(
self,
table: str,
params: Dict[str, Union[Callable, Dict[str, int], int, str]],
) -> None: ...
def __init__(self, table: str, params: Dict[str, Union[Callable, Dict[str, int], int, str]]) -> None: ...
class DatabaseCache(BaseDatabaseCache):
default_timeout: int
key_func: Callable
key_prefix: str
version: int
def get(
self,
key: str,
default: Optional[Union[int, str]] = ...,
version: Optional[int] = ...,
) -> Any: ...
def set(
self,
key: str,
value: Any,
timeout: Any = ...,
version: Optional[int] = ...,
) -> None: ...
def get(self, key: str, default: Optional[Union[int, str]] = ..., version: Optional[int] = ...) -> Any: ...
def set(self, key: str, value: Any, timeout: Any = ..., version: Optional[int] = ...) -> None: ...
def add(
self,
key: str,
value: Union[Dict[str, int], bytes, int, str],
timeout: Any = ...,
version: Optional[int] = ...,
) -> bool: ...
def touch(
self, key: str, timeout: Any = ..., version: None = ...
self, key: str, value: Union[Dict[str, int], bytes, int, str], timeout: Any = ..., version: Optional[int] = ...
) -> bool: ...
def touch(self, key: str, timeout: Any = ..., version: None = ...) -> bool: ...
def delete(self, key: str, version: Optional[int] = ...) -> None: ...
def has_key(self, key: str, version: Optional[int] = ...) -> Any: ...
def clear(self) -> None: ...

View File

@@ -2,32 +2,16 @@ from typing import Any, Dict, Optional, Union
from django.core.cache.backends.base import BaseCache
class DummyCache(BaseCache):
default_timeout: int
key_func: Callable
key_prefix: str
version: int
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 touch(
self, key: str, timeout: Any = ..., version: None = ...
) -> bool: ...
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 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: ...
def clear(self) -> None: ...

View File

@@ -2,41 +2,19 @@ from typing import Any, Callable, Dict, Optional, Union
from django.core.cache.backends.base import BaseCache
class FileBasedCache(BaseCache):
default_timeout: int
key_func: Callable
key_prefix: str
version: int
cache_suffix: str = ...
def __init__(
self,
dir: str,
params: Dict[str, Union[Callable, Dict[str, int], int, str]],
) -> None: ...
def __init__(self, dir: str, params: Dict[str, Union[Callable, Dict[str, int], int, str]]) -> None: ...
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 set(
self,
key: str,
value: Any,
timeout: Any = ...,
version: Optional[int] = ...,
) -> None: ...
def touch(
self, key: str, timeout: Any = ..., version: None = ...
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 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: ...
def has_key(self, key: str, version: Optional[int] = ...) -> bool: ...
def clear(self) -> None: ...

View File

@@ -2,17 +2,12 @@ from typing import Any, Callable, Dict, Optional, Union
from django.core.cache.backends.base import BaseCache
class LocMemCache(BaseCache):
default_timeout: int
key_func: Callable
key_prefix: str
version: int
def __init__(
self,
name: str,
params: Dict[str, Optional[Union[Callable, Dict[str, int], int, str]]],
) -> None: ...
def __init__(self, name: str, params: Dict[str, Optional[Union[Callable, Dict[str, int], int, str]]]) -> None: ...
def add(
self,
key: str,
@@ -20,28 +15,10 @@ 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 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: ...
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: ...
def has_key(self, key: str, version: Optional[int] = ...) -> Any: ...
def delete(self, key: str, version: Optional[int] = ...) -> None: ...
def clear(self) -> None: ...

View File

@@ -2,6 +2,4 @@ from typing import Any, List, Optional, Union
TEMPLATE_FRAGMENT_KEY_TEMPLATE: str
def make_template_fragment_key(
fragment_name: str, vary_on: Optional[Union[List[int], List[str]]] = ...
) -> str: ...
def make_template_fragment_key(fragment_name: str, vary_on: Optional[Union[List[int], List[str]]] = ...) -> str: ...

View File

@@ -4,6 +4,4 @@ from django.core.checks.messages import Error
E001: Any
def check_default_cache_is_configured(
app_configs: None, **kwargs: Any
) -> List[Error]: ...
def check_default_cache_is_configured(app_configs: None, **kwargs: Any) -> List[Error]: ...

View File

@@ -1,4 +1,3 @@
from typing import Any, List, Optional
def check_database_backends(*args: Any, **kwargs: Any) -> List[Any]: ...

View File

@@ -12,14 +12,7 @@ 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: ...

View File

@@ -2,10 +2,5 @@ from typing import Any, List, Optional
from django.core.checks.messages import Warning
def check_all_models(
app_configs: None = ..., **kwargs: Any
) -> List[Warning]: ...
def check_lazy_references(
app_configs: None = ..., **kwargs: Any
) -> List[Any]: ...
def check_all_models(app_configs: None = ..., **kwargs: Any) -> List[Warning]: ...
def check_lazy_references(app_configs: None = ..., **kwargs: Any) -> List[Any]: ...

View File

@@ -3,7 +3,6 @@ from typing import Any, Callable, List, Optional, Set, Union
from django.apps.config import AppConfig
from django.core.checks.messages import CheckMessage
class Tags:
admin: str = ...
caches: str = ...
@@ -19,25 +18,13 @@ 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[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 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]: ...
def get_checks(self, include_deployment_checks: bool = ...) -> List[Callable]: ...
registry: Any
register: Any

View File

@@ -17,20 +17,12 @@ W019: Any
W020: Any
W021: Any
def check_security_middleware(
app_configs: None, **kwargs: Any
) -> List[Warning]: ...
def check_xframe_options_middleware(
app_configs: None, **kwargs: Any
) -> List[Warning]: ...
def check_security_middleware(app_configs: None, **kwargs: Any) -> List[Warning]: ...
def check_xframe_options_middleware(app_configs: None, **kwargs: Any) -> List[Warning]: ...
def check_sts(app_configs: None, **kwargs: Any) -> List[Warning]: ...
def check_sts_include_subdomains(
app_configs: None, **kwargs: Any
) -> List[Warning]: ...
def check_sts_include_subdomains(app_configs: None, **kwargs: Any) -> List[Warning]: ...
def check_sts_preload(app_configs: None, **kwargs: Any) -> List[Warning]: ...
def check_content_type_nosniff(
app_configs: None, **kwargs: Any
) -> List[Warning]: ...
def check_content_type_nosniff(app_configs: None, **kwargs: Any) -> List[Warning]: ...
def check_xss_filter(app_configs: None, **kwargs: Any) -> List[Warning]: ...
def check_ssl_redirect(app_configs: None, **kwargs: Any) -> List[Warning]: ...
def check_secret_key(app_configs: None, **kwargs: Any) -> List[Warning]: ...

View File

@@ -5,9 +5,5 @@ from django.core.checks.messages import Warning
W003: Any
W016: Any
def check_csrf_middleware(
app_configs: None, **kwargs: Any
) -> List[Warning]: ...
def check_csrf_cookie_secure(
app_configs: None, **kwargs: Any
) -> List[Warning]: ...
def check_csrf_middleware(app_configs: None, **kwargs: Any) -> List[Warning]: ...
def check_csrf_cookie_secure(app_configs: None, **kwargs: Any) -> List[Warning]: ...

View File

@@ -2,7 +2,6 @@ from typing import Any, List, Optional
from django.core.checks.messages import Warning
def add_session_cookie_message(message: Any): ...
W010: Any
@@ -15,9 +14,5 @@ W013: Any
W014: Any
W015: Any
def check_session_cookie_secure(
app_configs: None, **kwargs: Any
) -> List[Warning]: ...
def check_session_cookie_httponly(
app_configs: None, **kwargs: Any
) -> List[Warning]: ...
def check_session_cookie_secure(app_configs: None, **kwargs: Any) -> List[Warning]: ...
def check_session_cookie_httponly(app_configs: None, **kwargs: Any) -> List[Warning]: ...

View File

@@ -5,9 +5,5 @@ from django.core.checks.messages import Error
E001: Any
E002: Any
def check_setting_app_dirs_loaders(
app_configs: None, **kwargs: Any
) -> List[Error]: ...
def check_string_if_invalid_is_string(
app_configs: None, **kwargs: Any
) -> List[Error]: ...
def check_setting_app_dirs_loaders(app_configs: None, **kwargs: Any) -> List[Error]: ...
def check_string_if_invalid_is_string(app_configs: None, **kwargs: Any) -> List[Error]: ...

View File

@@ -3,16 +3,9 @@ from typing import Any, Callable, List, Optional, Tuple, Union
from django.core.checks.messages import CheckMessage, Error, Warning
from django.urls.resolvers import URLPattern, URLResolver
def check_url_config(
app_configs: None, **kwargs: Any
) -> List[CheckMessage]: ...
def check_resolver(
resolver: Union[Tuple[str, Callable], URLPattern, URLResolver]
) -> List[CheckMessage]: ...
def check_url_namespaces_unique(
app_configs: None, **kwargs: Any
) -> List[Warning]: ...
def check_url_config(app_configs: None, **kwargs: Any) -> List[CheckMessage]: ...
def check_resolver(resolver: Union[Tuple[str, Callable], URLPattern, URLResolver]) -> List[CheckMessage]: ...
def check_url_namespaces_unique(app_configs: None, **kwargs: Any) -> List[Warning]: ...
def get_warning_for_invalid_pattern(pattern: Any) -> List[Error]: ...
def check_url_settings(app_configs: None, **kwargs: Any) -> List[Error]: ...
def E006(name: str) -> Error: ...

View File

@@ -3,7 +3,6 @@ from typing import Any, Dict, Iterator, List, Optional, Tuple, Type, Union
from django.db.models.base import Model
from django.forms.utils import ErrorDict, ErrorList
class FieldDoesNotExist(Exception): ...
class AppRegistryNotReady(Exception): ...
@@ -43,12 +42,7 @@ 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]]: ...

View File

@@ -3,7 +3,6 @@ from typing import Any, Iterator, Optional, Union
from django.core.files.utils import FileProxyMixin
class File(FileProxyMixin):
DEFAULT_CHUNK_SIZE: Any = ...
file: StringIO = ...
@@ -13,9 +12,7 @@ class File(FileProxyMixin):
def __bool__(self) -> bool: ...
def __len__(self) -> int: ...
def size(self) -> int: ...
def chunks(
self, chunk_size: Optional[int] = ...
) -> Iterator[Union[bytes, bytearray]]: ...
def chunks(self, chunk_size: Optional[int] = ...) -> Iterator[Union[bytes, bytearray]]: ...
def multiple_chunks(self, chunk_size: Optional[Any] = ...): ...
def __iter__(self) -> Iterator[Union[bytes, str]]: ...
def __enter__(self) -> File: ...
@@ -26,9 +23,7 @@ class File(FileProxyMixin):
class ContentFile(File):
file: StringIO
size: Any = ...
def __init__(
self, content: Union[bytes, str], name: Optional[str] = ...
) -> None: ...
def __init__(self, content: Union[bytes, str], name: Optional[str] = ...) -> None: ...
def __bool__(self) -> bool: ...
def open(self, mode: Optional[str] = ...) -> ContentFile: ...
def close(self) -> None: ...

View File

@@ -3,7 +3,6 @@ from typing import Any, Union
from django.core.files import File
class ImageFile(File):
file: BufferedReader
mode: str
@@ -13,7 +12,4 @@ class ImageFile(File):
@property
def height(self) -> int: ...
def get_image_dimensions(
file_or_path: Union[BufferedReader, BytesIO, ImageFile, str],
close: bool = ...,
) -> Any: ...
def get_image_dimensions(file_or_path: Union[BufferedReader, BytesIO, ImageFile, str], close: bool = ...) -> Any: ...

View File

@@ -1,9 +1,3 @@
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: ...

View File

@@ -5,19 +5,13 @@ from typing import Any, List, Optional, Tuple, Type, Union
from django.core.files.base import File
from django.utils.functional import LazyObject
class Storage:
def open(self, name: str, mode: str = ...) -> File: ...
def save(
self,
name: Optional[str],
content: Union[StringIO, TextIOWrapper, File],
max_length: Optional[int] = ...,
self, name: Optional[str], content: Union[StringIO, TextIOWrapper, File], max_length: Optional[int] = ...
) -> str: ...
def get_valid_name(self, name: str) -> str: ...
def get_available_name(
self, name: str, max_length: Optional[int] = ...
) -> str: ...
def get_available_name(self, name: str, max_length: Optional[int] = ...) -> str: ...
def generate_filename(self, filename: str) -> str: ...
def path(self, name: str) -> Any: ...
def delete(self, name: Any) -> None: ...

View File

@@ -4,7 +4,6 @@ from typing import Any, Dict, Iterator, Optional, Union
from django.core.files.base import File
class UploadedFile(File):
file: None
size: Any = ...
@@ -26,12 +25,7 @@ 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: ...
@@ -55,11 +49,6 @@ class InMemoryUploadedFile(UploadedFile):
class SimpleUploadedFile(InMemoryUploadedFile):
file: _io.BytesIO
def __init__(
self,
name: str,
content: Optional[Union[bytes, str]],
content_type: str = ...,
) -> None: ...
def __init__(self, name: str, content: Optional[Union[bytes, str]], content_type: str = ...) -> None: ...
@classmethod
def from_dict(cls, file_dict: Any): ...

View File

@@ -1,11 +1,9 @@
from io import BytesIO
from typing import Any, Dict, Optional, Union
from django.core.files.uploadedfile import (InMemoryUploadedFile,
TemporaryUploadedFile)
from django.core.files.uploadedfile import InMemoryUploadedFile, TemporaryUploadedFile
from django.core.handlers.wsgi import WSGIRequest
class UploadFileException(Exception): ...
class StopUpload(UploadFileException):
@@ -76,11 +74,7 @@ class MemoryFileUploadHandler(FileUploadHandler):
) -> None: ...
file: Any = ...
def new_file(self, *args: Any, **kwargs: Any) -> None: ...
def receive_data_chunk(
self, raw_data: bytes, start: int
) -> Optional[bytes]: ...
def file_complete(
self, file_size: int
) -> Optional[InMemoryUploadedFile]: ...
def receive_data_chunk(self, raw_data: bytes, start: int) -> Optional[bytes]: ...
def file_complete(self, file_size: int) -> Optional[InMemoryUploadedFile]: ...
def load_handler(path: str, *args: Any, **kwargs: Any) -> FileUploadHandler: ...

View File

@@ -1,6 +1,5 @@
from typing import Any, Optional
class FileProxyMixin:
encoding: Any = ...
fileno: Any = ...

View File

@@ -10,10 +10,6 @@ logger: Any
class BaseHandler:
def load_middleware(self) -> None: ...
def make_view_atomic(self, view: Callable) -> Callable: ...
def get_exception_response(
self, request: Any, resolver: Any, status_code: Any, exception: Any
): ...
def get_exception_response(self, request: Any, resolver: Any, status_code: Any, exception: Any): ...
def get_response(self, request: WSGIRequest) -> HttpResponseBase: ...
def process_exception_by_middleware(
self, exception: Exception, request: WSGIRequest
) -> HttpResponse: ...
def process_exception_by_middleware(self, exception: Exception, request: WSGIRequest) -> HttpResponse: ...

View File

@@ -4,16 +4,9 @@ from django.core.handlers.wsgi import WSGIRequest
from django.http.response import HttpResponse
from django.urls.resolvers import URLResolver
def convert_exception_to_response(get_response: Callable) -> Callable: ...
def response_for_exception(
request: WSGIRequest, exc: Exception
) -> HttpResponse: ...
def response_for_exception(request: WSGIRequest, exc: Exception) -> HttpResponse: ...
def get_exception_response(
request: WSGIRequest,
resolver: URLResolver,
status_code: int,
exception: Exception,
sender: None = ...,
request: WSGIRequest, resolver: URLResolver, status_code: int, exception: Exception, sender: None = ...
) -> HttpResponse: ...
def handle_uncaught_exception(request: Any, resolver: Any, exc_info: Any): ...

View File

@@ -9,28 +9,17 @@ from django.http.request import QueryDict
from django.http.response import HttpResponse
from django.utils.datastructures import MultiValueDict
_Stream = Union[BytesIO, str]
class LimitedStream:
stream: _Stream = ...
remaining: int = ...
buffer: bytes = ...
buf_size: int = ...
def __init__(
self,
stream: _Stream,
limit: int,
buf_size: int = ...,
) -> None: ...
def __init__(self, stream: _Stream, limit: int, buf_size: int = ...) -> None: ...
def read(self, size: Optional[int] = ...) -> bytes: ...
def readline(self, size: Optional[int] = ...) -> bytes: ...
class WSGIRequest(HttpRequest):
content_params: Dict[str, str]
content_type: str
@@ -44,42 +33,19 @@ class WSGIRequest(HttpRequest):
method: str = ...
encoding: Any = ...
resolver_match: None = ...
def __init__(self, environ: Dict[str, Any]) -> None: ...
def GET(self) -> QueryDict: ...
def COOKIES(self) -> Dict[str, str]: ...
@property
def FILES(self) -> MultiValueDict: ...
POST: Any = ...
class WSGIHandler(base.BaseHandler):
request_class: Any = ...
def __init__(self, *args: Any, **kwargs: Any) -> None: ...
def __call__(
self,
environ: Dict[str, Any],
start_response: Callable,
) -> HttpResponse: ...
def __call__(self, environ: Dict[str, Any], start_response: Callable) -> HttpResponse: ...
def get_path_info(environ: Dict[str, Any]) -> str: ...
def get_script_name(environ: Dict[str, Any]) -> str: ...
def get_bytes_from_wsgi(
environ: Dict[str, Any], key: str, default: str
) -> bytes: ...
def get_str_from_wsgi(
environ: Dict[str, Any], key: str, default: str
) -> str: ...
def get_bytes_from_wsgi(environ: Dict[str, Any], key: str, default: str) -> bytes: ...
def get_str_from_wsgi(environ: Dict[str, Any], key: str, default: str) -> str: ...

View File

@@ -1,24 +1,18 @@
from typing import Any, List, Optional, Tuple
from django.core.mail.backends.base import BaseEmailBackend
from django.core.mail.message import \
DEFAULT_ATTACHMENT_MIME_TYPE as DEFAULT_ATTACHMENT_MIME_TYPE
from django.core.mail.message import DEFAULT_ATTACHMENT_MIME_TYPE as DEFAULT_ATTACHMENT_MIME_TYPE
from django.core.mail.message import BadHeaderError as BadHeaderError
from django.core.mail.message import EmailMessage as EmailMessage
from django.core.mail.message import \
EmailMultiAlternatives as EmailMultiAlternatives
from django.core.mail.message import EmailMultiAlternatives as EmailMultiAlternatives
from django.core.mail.message import SafeMIMEMultipart as SafeMIMEMultipart
from django.core.mail.message import SafeMIMEText as SafeMIMEText
from django.core.mail.message import \
forbid_multi_line_headers as forbid_multi_line_headers
from django.core.mail.message import forbid_multi_line_headers as forbid_multi_line_headers
from django.core.mail.message import make_msgid as make_msgid
from django.core.mail.utils import DNS_NAME as DNS_NAME
from django.core.mail.utils import CachedDnsName as CachedDnsName
def get_connection(
backend: Optional[str] = ..., fail_silently: bool = ..., **kwds: Any
) -> BaseEmailBackend: ...
def get_connection(backend: Optional[str] = ..., fail_silently: bool = ..., **kwds: Any) -> BaseEmailBackend: ...
def send_mail(
subject: str,
message: str,

View File

@@ -1,13 +1,10 @@
from typing import Any, Optional
class BaseEmailBackend:
fail_silently: Any = ...
def __init__(self, fail_silently: bool = ..., **kwargs: Any) -> None: ...
def open(self) -> None: ...
def close(self) -> None: ...
def __enter__(self) -> BaseEmailBackend: ...
def __exit__(
self, exc_type: None, exc_value: None, traceback: None
) -> None: ...
def __exit__(self, exc_type: None, exc_value: None, traceback: None) -> None: ...
def send_messages(self, email_messages: Any) -> None: ...

View File

@@ -3,12 +3,9 @@ from typing import Any, Iterator, List, Optional, Union
from django.core.mail.backends.base import BaseEmailBackend
from django.core.mail.message import EmailMessage
class EmailBackend(BaseEmailBackend):
fail_silently: bool
stream: _io.StringIO = ...
def __init__(self, *args: Any, **kwargs: Any) -> None: ...
def write_message(self, message: EmailMessage) -> None: ...
def send_messages(
self, email_messages: Union[Iterator[Any], List[EmailMessage]]
) -> int: ...
def send_messages(self, email_messages: Union[Iterator[Any], List[EmailMessage]]) -> int: ...

View File

@@ -3,7 +3,6 @@ from typing import Any, List, Optional
from django.core.mail.backends.base import BaseEmailBackend
from django.core.mail.message import EmailMessage
class EmailBackend(BaseEmailBackend):
fail_silently: bool
def send_messages(self, email_messages: List[EmailMessage]) -> int: ...

View File

@@ -1,16 +1,12 @@
from typing import Any, Optional
from django.core.mail.backends.console import \
EmailBackend as ConsoleEmailBackend
from django.core.mail.backends.console import EmailBackend as ConsoleEmailBackend
from django.core.mail.message import EmailMessage
class EmailBackend(ConsoleEmailBackend):
fail_silently: bool
file_path: str = ...
def __init__(
self, *args: Any, file_path: Optional[Any] = ..., **kwargs: Any
) -> None: ...
def __init__(self, *args: Any, file_path: Optional[Any] = ..., **kwargs: Any) -> None: ...
def write_message(self, message: EmailMessage) -> None: ...
stream: None = ...
def open(self) -> bool: ...

View File

@@ -3,10 +3,7 @@ from typing import Any, Iterator, List, Optional, Union
from django.core.mail.backends.base import BaseEmailBackend
from django.core.mail.message import EmailMessage
class EmailBackend(BaseEmailBackend):
fail_silently: bool
def __init__(self, *args: Any, **kwargs: Any) -> None: ...
def send_messages(
self, messages: Union[Iterator[Any], List[EmailMessage]]
) -> int: ...
def send_messages(self, messages: Union[Iterator[Any], List[EmailMessage]]) -> int: ...

View File

@@ -4,7 +4,6 @@ from typing import Any, Iterator, List, Optional, Type, Union
from django.core.mail.backends.base import BaseEmailBackend
from django.core.mail.message import EmailMessage
class EmailBackend(BaseEmailBackend):
fail_silently: bool
host: Any = ...
@@ -35,6 +34,4 @@ class EmailBackend(BaseEmailBackend):
def connection_class(self) -> Type[SMTP]: ...
def open(self) -> Optional[bool]: ...
def close(self) -> None: ...
def send_messages(
self, email_messages: Union[Iterator[Any], List[EmailMessage]]
) -> int: ...
def send_messages(self, email_messages: Union[Iterator[Any], List[EmailMessage]]) -> int: ...

View File

@@ -14,13 +14,9 @@ class BadHeaderError(ValueError): ...
ADDRESS_HEADERS: Any
def forbid_multi_line_headers(
name: str, val: str, encoding: str
) -> Tuple[str, str]: ...
def forbid_multi_line_headers(name: str, val: str, encoding: str) -> Tuple[str, str]: ...
def split_addr(addr: str, encoding: str) -> Tuple[str, str]: ...
def sanitize_address(
addr: Union[Tuple[str, str], str], encoding: str
) -> str: ...
def sanitize_address(addr: Union[Tuple[str, str], str], encoding: str) -> str: ...
class MIMEMixin:
def as_string(self, unixfrom: bool = ..., linesep: str = ...) -> str: ...
@@ -39,9 +35,7 @@ class SafeMIMEText(MIMEMixin, MIMEText):
policy: email._policybase.Compat32
preamble: None
encoding: str = ...
def __init__(
self, _text: str, _subtype: str = ..., _charset: str = ...
) -> None: ...
def __init__(self, _text: str, _subtype: str = ..., _charset: str = ...) -> None: ...
def __setitem__(self, name: str, val: str) -> None: ...
def set_payload(self, payload: str, charset: str = ...) -> None: ...
@@ -52,12 +46,7 @@ class SafeMIMEMultipart(MIMEMixin, MIMEMultipart):
preamble: None
encoding: str = ...
def __init__(
self,
_subtype: str = ...,
boundary: None = ...,
_subparts: None = ...,
encoding: str = ...,
**_params: Any
self, _subtype: str = ..., boundary: None = ..., _subparts: None = ..., encoding: str = ..., **_params: Any
) -> None: ...
def __setitem__(self, name: str, val: str) -> None: ...
@@ -83,9 +72,7 @@ class EmailMessage:
to: Optional[Union[List[str], Tuple[str, str], str]] = ...,
bcc: Optional[Union[List[str], Tuple[str], str]] = ...,
connection: Optional[BaseEmailBackend] = ...,
attachments: Optional[
Union[List[Tuple[str, str]], List[MIMEText]]
] = ...,
attachments: Optional[Union[List[Tuple[str, str]], List[MIMEText]]] = ...,
headers: Optional[Dict[str, str]] = ...,
cc: Optional[Union[List[str], Tuple[str, str], str]] = ...,
reply_to: Optional[Union[List[Optional[str]], str]] = ...,

View File

@@ -1,6 +1,5 @@
from typing import Any, Optional
class CachedDnsName:
def get_fqdn(self) -> str: ...

View File

@@ -2,15 +2,10 @@ from typing import Any, Dict, List, Optional, Tuple, Union
from django.core.management.base import BaseCommand
def find_commands(management_dir: str) -> List[str]: ...
def load_command_class(app_name: str, name: str) -> BaseCommand: ...
def get_commands() -> Dict[str, str]: ...
def call_command(
command_name: Union[Tuple[str], BaseCommand, str],
*args: Any,
**options: Any
) -> Optional[str]: ...
def call_command(command_name: Union[Tuple[str], BaseCommand, str], *args: Any, **options: Any) -> Optional[str]: ...
class ManagementUtility:
argv: List[str] = ...

View File

@@ -4,7 +4,6 @@ from typing import Any, Callable, List, Optional, Tuple, Union
from django.apps.config import AppConfig
class CommandError(Exception): ...
class SystemCheckError(CommandError): ...
@@ -23,9 +22,7 @@ class CommandParser(ArgumentParser):
missing_args_message: None = ...
called_from_command_line: bool = ...
def __init__(self, **kwargs: Any) -> None: ...
def parse_args(
self, args: List[str] = ..., namespace: None = ...
) -> Namespace: ...
def parse_args(self, args: List[str] = ..., namespace: None = ...) -> Namespace: ...
def error(self, message: str) -> Any: ...
def handle_default_options(options: Namespace) -> None: ...
@@ -33,9 +30,7 @@ def no_translations(handle_func: Callable) -> Callable: ...
class DjangoHelpFormatter(HelpFormatter):
show_last: Any = ...
def add_usage(
self, usage: None, actions: List[Any], *args: Any, **kwargs: Any
) -> None: ...
def add_usage(self, usage: None, actions: List[Any], *args: Any, **kwargs: Any) -> None: ...
def add_arguments(self, actions: List[Any]) -> None: ...
class OutputWrapper(TextIOBase):
@@ -45,20 +40,10 @@ 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: ...
def write(self, msg: str, style_func: Optional[Callable] = ..., ending: Optional[str] = ...) -> None: ...
class BaseCommand:
help: str = ...
@@ -70,22 +55,13 @@ 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 create_parser(self, prog_name: str, subcommand: str) -> CommandParser: ...
def add_arguments(self, parser: CommandParser) -> None: ...
def print_help(self, prog_name: str, subcommand: str) -> None: ...
def run_from_argv(self, argv: List[str]) -> None: ...
def execute(
self, *args: Any, **options: Any
) -> Optional[Union[Tuple, str]]: ...
def execute(self, *args: Any, **options: Any) -> Optional[Union[Tuple, str]]: ...
def check(
self,
app_configs: Optional[List[AppConfig]] = ...,

View File

@@ -1,6 +1,5 @@
from typing import Optional
def supports_color() -> bool: ...
class Style: ...

View File

@@ -2,7 +2,6 @@ from typing import Any, Optional
from django.core.management.base import BaseCommand, CommandParser
class Command(BaseCommand):
stderr: django.core.management.base.OutputWrapper
stdout: django.core.management.base.OutputWrapper

View File

@@ -2,7 +2,6 @@ from typing import Any, List, Optional, Tuple
from django.core.management.base import BaseCommand, CommandParser
def has_bom(fn: str) -> bool: ...
def is_writable(path: str) -> bool: ...

View File

@@ -2,7 +2,6 @@ from typing import Any, Optional
from django.core.management.base import BaseCommand, CommandParser
class Command(BaseCommand):
stderr: django.core.management.base.OutputWrapper
stdout: django.core.management.base.OutputWrapper
@@ -12,6 +11,4 @@ class Command(BaseCommand):
def add_arguments(self, parser: CommandParser) -> None: ...
verbosity: Any = ...
def handle(self, *tablenames: Any, **options: Any) -> None: ...
def create_table(
self, database: str, tablename: str, dry_run: bool
) -> None: ...
def create_table(self, database: str, tablename: str, dry_run: bool) -> None: ...

View File

@@ -2,7 +2,6 @@ from typing import Any, Optional
from django.core.management.base import BaseCommand, CommandParser
class ProxyModelWarning(Warning): ...
class Command(BaseCommand):

View File

@@ -2,7 +2,6 @@ from typing import Any, Optional
from django.core.management.base import BaseCommand, CommandParser
class Command(BaseCommand):
stderr: django.core.management.base.OutputWrapper
stdout: django.core.management.base.OutputWrapper

View File

@@ -5,7 +5,6 @@ from django.core.management.base import BaseCommand, CommandParser
from django.db.backends.base.introspection import FieldInfo
from django.db.backends.sqlite3.base import DatabaseWrapper
class Command(BaseCommand):
stderr: django.core.management.base.OutputWrapper
stdout: django.core.management.base.OutputWrapper

View File

@@ -27,13 +27,9 @@ class Command(BaseCommand):
compression_formats: Any = ...
def loaddata(self, fixture_labels: Tuple[str]) -> None: ...
def load_label(self, fixture_label: str) -> None: ...
def find_fixtures(
self, fixture_label: str
) -> List[Tuple[str, Optional[str], str]]: ...
def find_fixtures(self, fixture_label: str) -> List[Tuple[str, Optional[str], str]]: ...
def fixture_dirs(self) -> List[str]: ...
def parse_name(
self, fixture_name: str
) -> Tuple[str, Optional[str], Optional[str]]: ...
def parse_name(self, fixture_name: str) -> Tuple[str, Optional[str], Optional[str]]: ...
class SingleZipReader(zipfile.ZipFile):
NameToInfo: Dict[str, zipfile.ZipInfo]

View File

@@ -12,9 +12,7 @@ class TranslatableFile:
file: str = ...
dirpath: str = ...
locale_dir: str = ...
def __init__(
self, dirpath: str, file_name: str, locale_dir: Any
) -> None: ...
def __init__(self, dirpath: str, file_name: str, locale_dir: Any) -> None: ...
def __eq__(self, other: TranslatableFile) -> bool: ...
def __lt__(self, other: TranslatableFile) -> bool: ...
@property
@@ -24,9 +22,7 @@ class BuildFile:
command: django.core.management.commands.makemessages.Command = ...
domain: str = ...
translatable: django.core.management.commands.makemessages.TranslatableFile = ...
def __init__(
self, command: Command, domain: str, translatable: TranslatableFile
) -> None: ...
def __init__(self, command: Command, domain: str, translatable: TranslatableFile) -> None: ...
def is_templatized(self) -> bool: ...
def path(self) -> str: ...
def work_path(self) -> str: ...
@@ -67,8 +63,6 @@ class Command(BaseCommand):
def remove_potfiles(self) -> None: ...
def find_files(self, root: str) -> List[TranslatableFile]: ...
def process_files(self, file_list: List[TranslatableFile]) -> None: ...
def process_locale_dir(
self, locale_dir: Any, files: List[TranslatableFile]
) -> None: ...
def process_locale_dir(self, locale_dir: Any, files: List[TranslatableFile]) -> None: ...
def write_po_file(self, potfile: str, locale: str) -> None: ...
def copy_plural_forms(self, msgs: str, locale: str) -> str: ...

View File

@@ -4,7 +4,6 @@ from django.core.management.base import BaseCommand, CommandParser
from django.db.migrations.loader import MigrationLoader
from django.db.migrations.migration import Migration
class Command(BaseCommand):
stderr: django.core.management.base.OutputWrapper
stdout: django.core.management.base.OutputWrapper
@@ -18,9 +17,5 @@ class Command(BaseCommand):
empty: bool = ...
migration_name: None = ...
def handle(self, *app_labels: Any, **options: Any): ...
def write_migration_files(
self, changes: Dict[str, List[Migration]]
) -> None: ...
def handle_merge(
self, loader: MigrationLoader, conflicts: Dict[str, Set[str]]
) -> None: ...
def write_migration_files(self, changes: Dict[str, List[Migration]]) -> None: ...
def handle_merge(self, loader: MigrationLoader, conflicts: Dict[str, Set[str]]) -> None: ...

View File

@@ -4,7 +4,6 @@ from django.core.management.base import BaseCommand, CommandParser
from django.db.backends.sqlite3.base import DatabaseWrapper
from django.db.migrations.migration import Migration
class Command(BaseCommand):
stderr: django.core.management.base.OutputWrapper
stdout: django.core.management.base.OutputWrapper
@@ -15,12 +14,5 @@ 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 sync_apps(
self, connection: DatabaseWrapper, app_labels: Set[str]
) -> 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: ...

View File

@@ -2,7 +2,6 @@ from typing import Any, Optional
from django.core.management.base import BaseCommand, CommandParser
class Command(BaseCommand):
stderr: django.core.management.base.OutputWrapper
stdout: django.core.management.base.OutputWrapper

View File

@@ -3,7 +3,6 @@ from typing import Any, Dict, Optional, Union
from django.core.management import BaseCommand
from django.core.management.base import CommandParser
class Command(BaseCommand):
stderr: django.core.management.base.OutputWrapper
stdout: django.core.management.base.OutputWrapper

View File

@@ -3,7 +3,6 @@ from typing import Any, List, Optional
from django.core.management.base import BaseCommand, CommandParser
from django.db.backends.sqlite3.base import DatabaseWrapper
class Command(BaseCommand):
stderr: django.core.management.base.OutputWrapper
stdout: django.core.management.base.OutputWrapper
@@ -12,9 +11,5 @@ class Command(BaseCommand):
def add_arguments(self, parser: CommandParser) -> None: ...
verbosity: Any = ...
def handle(self, *args: Any, **options: Any) -> None: ...
def show_list(
self, connection: DatabaseWrapper, app_names: List[str] = ...
) -> None: ...
def show_plan(
self, connection: DatabaseWrapper, app_names: List[str] = ...
) -> None: ...
def show_list(self, connection: DatabaseWrapper, app_names: List[str] = ...) -> None: ...
def show_plan(self, connection: DatabaseWrapper, app_names: List[str] = ...) -> None: ...

View File

@@ -2,7 +2,6 @@ from typing import Any, Optional
from django.core.management.base import BaseCommand, CommandParser
class Command(BaseCommand):
stderr: django.core.management.base.OutputWrapper
stdout: django.core.management.base.OutputWrapper

View File

@@ -2,7 +2,6 @@ from typing import Any, Optional
from django.core.management.base import BaseCommand, CommandParser
class Command(BaseCommand):
stderr: django.core.management.base.OutputWrapper
stdout: django.core.management.base.OutputWrapper

View File

@@ -2,7 +2,6 @@ from typing import Any, Optional
from django.core.management.base import BaseCommand, CommandParser
class Command(BaseCommand):
stderr: django.core.management.base.OutputWrapper
stdout: django.core.management.base.OutputWrapper

View File

@@ -3,17 +3,8 @@ from typing import Any, List, Optional
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: ...
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: ...

View File

@@ -2,7 +2,6 @@ from typing import Any, Optional
from django.core.management.base import BaseCommand, CommandParser
class TemplateCommand(BaseCommand):
requires_system_checks: bool = ...
url_schemes: Any = ...
@@ -11,13 +10,7 @@ class TemplateCommand(BaseCommand):
app_or_project: Any = ...
paths_to_remove: Any = ...
verbosity: Any = ...
def handle(
self,
app_or_project: Any,
name: Any,
target: Optional[Any] = ...,
**options: Any
): ...
def handle(self, app_or_project: Any, name: Any, target: Optional[Any] = ..., **options: Any): ...
def handle_template(self, template: Any, subdir: Any): ...
def validate_name(self, name: Any, app_or_project: Any) -> None: ...
def download(self, url: Any): ...

View File

@@ -5,15 +5,8 @@ from django.db.models.base import Model
from .base import CommandError
def popen_wrapper(
args: List[str], stdout_encoding: str = ...
) -> Tuple[str, str, int]: ...
def popen_wrapper(args: List[str], stdout_encoding: str = ...) -> Tuple[str, str, int]: ...
def handle_extensions(extensions: List[str]) -> Set[str]: ...
def find_command(
cmd: str, path: None = ..., pathext: None = ...
) -> Optional[str]: ...
def find_command(cmd: str, path: None = ..., pathext: None = ...) -> Optional[str]: ...
def get_random_secret_key(): ...
def parse_apps_and_model_labels(
labels: List[str]
) -> Tuple[Set[Type[Model]], Set[AppConfig]]: ...
def parse_apps_and_model_labels(labels: List[str]) -> Tuple[Set[Type[Model]], Set[AppConfig]]: ...

View File

@@ -4,7 +4,6 @@ from typing import Any, Dict, List, Optional, Union
from django.db.models.base import Model
from django.db.models.query import QuerySet
class UnorderedObjectListWarning(RuntimeWarning): ...
class InvalidPage(Exception): ...
class PageNotAnInteger(InvalidPage): ...
@@ -17,9 +16,7 @@ class Paginator:
allow_empty_first_page: bool = ...
def __init__(
self,
object_list: Union[
List[Dict[str, str]], List[Model], List[int], QuerySet, str
],
object_list: Union[List[Dict[str, str]], List[Model], List[int], QuerySet, str],
per_page: Union[int, str],
orphans: int = ...,
allow_empty_first_page: bool = ...,
@@ -39,12 +36,7 @@ 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]: ...

View File

@@ -1,6 +1,5 @@
from collections import OrderedDict
from typing import (Any, Callable, Dict, Iterator, List, Optional, Tuple, Type,
Union)
from typing import Any, Callable, Dict, Iterator, List, Optional, Tuple, Type, Union
from django.apps.config import AppConfig
from django.core.serializers.base import Serializer
@@ -16,26 +15,16 @@ class BadSerializer:
def __init__(self, exception: ImportError) -> None: ...
def __call__(self, *args: Any, **kwargs: Any) -> Any: ...
def register_serializer(
format: str,
serializer_module: str,
serializers: Optional[Dict[str, Any]] = ...,
) -> None: ...
def register_serializer(format: str, serializer_module: str, serializers: Optional[Dict[str, Any]] = ...) -> None: ...
def unregister_serializer(format: str) -> None: ...
def get_serializer(format: str) -> Union[Type[Serializer], BadSerializer]: ...
def get_serializer_formats() -> List[str]: ...
def get_public_serializer_formats() -> List[str]: ...
def get_deserializer(format: str) -> Union[Callable, Type[Deserializer]]: ...
def serialize(
format: str,
queryset: Union[Iterator[Any], List[Model], QuerySet],
**options: Any
format: str, queryset: Union[Iterator[Any], List[Model], QuerySet], **options: Any
) -> Optional[Union[List[OrderedDict], bytes, str]]: ...
def deserialize(
format: str, stream_or_string: Any, **options: Any
) -> Union[Iterator[Any], Deserializer]: ...
def deserialize(format: str, stream_or_string: Any, **options: Any) -> Union[Iterator[Any], Deserializer]: ...
def sort_dependencies(
app_list: Union[
List[Tuple[AppConfig, None]], List[Tuple[str, List[Type[Model]]]]
]
app_list: Union[List[Tuple[AppConfig, None]], List[Tuple[str, List[Type[Model]]]]]
) -> List[Type[Model]]: ...

View File

@@ -10,35 +10,26 @@ from django.db.models.base import Model
from django.db.models.fields.related import ForeignKey, ManyToManyField
from django.db.models.query import QuerySet
class SerializerDoesNotExist(KeyError): ...
class SerializationError(Exception): ...
class DeserializationError(Exception):
@classmethod
def WithData(
cls,
original_exc: Exception,
model: str,
fk: Union[int, str],
field_value: Optional[Union[List[str], str]],
cls, original_exc: Exception, model: str, fk: Union[int, str], field_value: Optional[Union[List[str], str]]
) -> DeserializationError: ...
class M2MDeserializationError(Exception):
original_exc: django.core.exceptions.ObjectDoesNotExist = ...
pk: List[str] = ...
def __init__(
self, original_exc: Exception, pk: Union[List[str], str]
) -> None: ...
def __init__(self, original_exc: Exception, pk: Union[List[str], str]) -> None: ...
class ProgressBar:
progress_width: int = ...
output: None = ...
total_count: int = ...
prev_done: int = ...
def __init__(
self, output: Optional[Union[StringIO, OutputWrapper]], total_count: int
) -> None: ...
def __init__(self, output: Optional[Union[StringIO, OutputWrapper]], total_count: int) -> None: ...
def update(self, count: int) -> None: ...
class Serializer:
@@ -75,36 +66,18 @@ class Serializer:
class Deserializer:
options: Any = ...
stream: Any = ...
def __init__(
self,
stream_or_string: Union[BufferedReader, TextIOWrapper, str],
**options: Any
) -> None: ...
def __init__(self, stream_or_string: Union[BufferedReader, TextIOWrapper, str], **options: Any) -> None: ...
def __iter__(self) -> Deserializer: ...
def __next__(self) -> None: ...
class DeserializedObject:
object: django.db.models.base.Model = ...
m2m_data: Dict[Any, Any] = ...
def __init__(
self, obj: Model, m2m_data: Optional[Dict[str, List[int]]] = ...
) -> None: ...
def save(
self, save_m2m: bool = ..., using: Optional[str] = ..., **kwargs: Any
) -> None: ...
def __init__(self, obj: Model, m2m_data: Optional[Dict[str, List[int]]] = ...) -> None: ...
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 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_fk_value(
field: ForeignKey,
field_value: Optional[Union[List[str], Tuple[str], int, str]],
using: str,
field: ForeignKey, field_value: Optional[Union[List[str], Tuple[str], int, str]], using: str
) -> Optional[Union[int, str, UUID]]: ...

View File

@@ -7,11 +7,8 @@ from uuid import UUID
from django.core.serializers.python import Serializer as PythonSerializer
from django.db.models.base import Model
class Serializer(PythonSerializer):
json_kwargs: Dict[
str, Optional[Type[django.core.serializers.json.DjangoJSONEncoder]]
]
json_kwargs: Dict[str, Optional[Type[django.core.serializers.json.DjangoJSONEncoder]]]
options: Dict[str, None]
selected_fields: None
stream: _io.StringIO

View File

@@ -7,7 +7,6 @@ from django.db.models.base import Model
from django.db.models.fields import Field
from django.db.models.fields.related import ForeignKey, ManyToManyField
class Serializer(base.Serializer):
options: Dict[Any, Any]
selected_fields: None

View File

@@ -9,7 +9,6 @@ from django.core.serializers.python import Serializer as PythonSerializer
from django.db.models.base import Model
from django.db.models.fields import Field
class DjangoSafeDumper(SafeDumper):
alias_key: int
allow_unicode: None
@@ -33,24 +32,11 @@ class DjangoSafeDumper(SafeDumper):
last_anchor_id: int
line: int
mapping_context: bool
object_keeper: List[
Union[
List[collections.OrderedDict],
collections.OrderedDict,
datetime.datetime,
]
]
object_keeper: List[Union[List[collections.OrderedDict], collections.OrderedDict, datetime.datetime]]
open_ended: bool
prepared_anchor: None
prepared_tag: None
represented_objects: Dict[
int,
Union[
yaml.nodes.MappingNode,
yaml.nodes.ScalarNode,
yaml.nodes.SequenceNode,
],
]
represented_objects: Dict[int, Union[yaml.nodes.MappingNode, yaml.nodes.ScalarNode, yaml.nodes.SequenceNode]]
resolver_exact_paths: List[Any]
resolver_prefix_paths: List[Any]
root_context: bool

View File

@@ -9,7 +9,6 @@ from django.db.models.base import Model
from django.db.models.fields import Field
from django.db.models.fields.related import ForeignKey, ManyToManyField
class Serializer(base.Serializer):
options: Dict[str, None]
selected_fields: None
@@ -46,25 +45,12 @@ def getInnerText(node: Element) -> str: ...
class DefusedExpatParser(_ExpatParser):
def __init__(self, *args: Any, **kwargs: Any) -> None: ...
def start_doctype_decl(
self, name: str, sysid: str, pubid: None, has_internal_subset: int
) -> Any: ...
def start_doctype_decl(self, name: str, sysid: str, pubid: None, has_internal_subset: int) -> Any: ...
def entity_decl(
self,
name: Any,
is_parameter_entity: Any,
value: Any,
base: Any,
sysid: Any,
pubid: Any,
notation_name: Any,
) -> None: ...
def unparsed_entity_decl(
self, name: Any, base: Any, sysid: Any, pubid: Any, notation_name: Any
) -> None: ...
def external_entity_ref_handler(
self, context: Any, base: Any, sysid: Any, pubid: Any
self, name: Any, is_parameter_entity: Any, value: Any, base: Any, sysid: Any, pubid: Any, notation_name: Any
) -> None: ...
def unparsed_entity_decl(self, name: Any, base: Any, sysid: Any, pubid: Any, notation_name: Any) -> None: ...
def external_entity_ref_handler(self, context: Any, base: Any, sysid: Any, pubid: Any) -> None: ...
def reset(self) -> None: ...
class DefusedXmlException(ValueError): ...
@@ -82,21 +68,11 @@ class EntitiesForbidden(DefusedXmlException):
sysid: Any = ...
pubid: Any = ...
notation_name: Any = ...
def __init__(
self,
name: Any,
value: Any,
base: Any,
sysid: Any,
pubid: Any,
notation_name: Any,
) -> None: ...
def __init__(self, name: Any, value: Any, base: Any, sysid: Any, pubid: Any, notation_name: Any) -> None: ...
class ExternalReferenceForbidden(DefusedXmlException):
context: Any = ...
base: Any = ...
sysid: Any = ...
pubid: Any = ...
def __init__(
self, context: Any, base: Any, sysid: Any, pubid: Any
) -> None: ...
def __init__(self, context: Any, base: Any, sysid: Any, pubid: Any) -> None: ...

View File

@@ -5,18 +5,11 @@ from wsgiref import simple_server
from django.core.handlers.wsgi import WSGIRequest
class WSGIServer(simple_server.WSGIServer):
request_queue_size: int = ...
address_family: Any = ...
allow_reuse_address: Any = ...
def __init__(
self,
*args: Any,
ipv6: bool = ...,
allow_reuse_address: bool = ...,
**kwargs: Any
) -> None: ...
def __init__(self, *args: Any, ipv6: bool = ..., allow_reuse_address: bool = ..., **kwargs: Any) -> None: ...
def handle_error(self, request: Any, client_address: Any) -> None: ...
class ThreadedWSGIServer(socketserver.ThreadingMixIn, WSGIServer): ...

View File

@@ -3,21 +3,16 @@ from typing import Any, Dict, List, Optional, Type, Union
from django.contrib.sessions.serializers import PickleSerializer
class BadSignature(Exception): ...
class SignatureExpired(BadSignature): ...
def b64_encode(s: bytes) -> bytes: ...
def b64_decode(s: bytes) -> bytes: ...
def base64_hmac(
salt: str, value: Union[bytes, str], key: Union[bytes, str]
) -> str: ...
def base64_hmac(salt: str, value: Union[bytes, str], key: Union[bytes, str]) -> str: ...
def get_cookie_signer(salt: str = ...) -> TimestampSigner: ...
class JSONSerializer:
def dumps(
self, obj: Union[Dict[str, Union[int, str]], List[str], str]
) -> bytes: ...
def dumps(self, obj: Union[Dict[str, Union[int, str]], List[str], str]) -> bytes: ...
def loads(self, data: bytes) -> Dict[str, Union[int, str]]: ...
def dumps(
@@ -33,20 +28,13 @@ def loads(
salt: str = ...,
serializer: Type[Union[PickleSerializer, JSONSerializer]] = ...,
max_age: Optional[int] = ...,
) -> Union[
Dict[str, Union[datetime, str]], Dict[str, Union[int, str]], List[str], str
]: ...
) -> Union[Dict[str, Union[datetime, str]], Dict[str, Union[int, str]], List[str], str]: ...
class Signer:
key: str = ...
sep: str = ...
salt: Any = ...
def __init__(
self,
key: Optional[Union[bytes, str]] = ...,
sep: str = ...,
salt: Optional[str] = ...,
) -> None: ...
def __init__(self, key: Optional[Union[bytes, str]] = ..., sep: str = ..., salt: Optional[str] = ...) -> None: ...
def signature(self, value: Union[bytes, str]) -> str: ...
def sign(self, value: str) -> str: ...
def unsign(self, signed_value: str) -> str: ...

View File

@@ -23,9 +23,7 @@ class RegexValidator:
flags: Optional[RegexFlag] = ...,
) -> None: ...
def __call__(self, value: Optional[Union[float, str]]) -> None: ...
def __eq__(
self, other: Union[ProhibitNullCharactersValidator, RegexValidator]
) -> bool: ...
def __eq__(self, other: Union[ProhibitNullCharactersValidator, RegexValidator]) -> bool: ...
class URLValidator(RegexValidator):
ul: str = ...
@@ -38,9 +36,7 @@ class URLValidator(RegexValidator):
regex: django.utils.functional.SimpleLazyObject = ...
message: Any = ...
schemes: Any = ...
def __init__(
self, schemes: Optional[List[str]] = ..., **kwargs: Any
) -> None: ...
def __init__(self, schemes: Optional[List[str]] = ..., **kwargs: Any) -> None: ...
def __call__(self, value: str) -> None: ...
integer_validator: Any
@@ -54,12 +50,7 @@ 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: ...
@@ -77,12 +68,7 @@ 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
@@ -90,39 +76,23 @@ 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 __call__(
self, value: Union[bytes, datetime, Decimal, float, 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: ...
def clean(
self, x: Union[datetime, Decimal, float]
) -> Union[datetime, Decimal, float]: ...
def clean(self, x: Union[datetime, Decimal, float]) -> Union[datetime, Decimal, float]: ...
class MaxValueValidator(BaseValidator):
limit_value: decimal.Decimal
message: Any = ...
code: str = ...
def compare(
self,
a: Union[datetime, Decimal, float],
b: Union[datetime, Decimal, float],
) -> bool: ...
def compare(self, a: Union[datetime, Decimal, float], b: Union[datetime, Decimal, float]) -> bool: ...
class MinValueValidator(BaseValidator):
limit_value: int
message: Any = ...
code: str = ...
def compare(
self,
a: Union[datetime, Decimal, float],
b: Union[datetime, Decimal, float],
) -> bool: ...
def compare(self, a: Union[datetime, Decimal, float], b: Union[datetime, Decimal, float]) -> bool: ...
class MinLengthValidator(BaseValidator):
limit_value: int
@@ -142,25 +112,16 @@ class DecimalValidator:
messages: Any = ...
max_digits: int = ...
decimal_places: int = ...
def __init__(
self,
max_digits: Optional[Union[int, str]],
decimal_places: Optional[Union[int, str]],
) -> None: ...
def __init__(self, max_digits: Optional[Union[int, str]], decimal_places: Optional[Union[int, str]]) -> None: ...
def __call__(self, value: Decimal) -> None: ...
def __eq__(
self, other: Union[DecimalValidator, MinValueValidator]
) -> bool: ...
def __eq__(self, other: Union[DecimalValidator, MinValueValidator]) -> bool: ...
class FileExtensionValidator:
message: Any = ...
code: str = ...
allowed_extensions: List[str] = ...
def __init__(
self,
allowed_extensions: Optional[List[str]] = ...,
message: Optional[str] = ...,
code: Optional[str] = ...,
self, allowed_extensions: Optional[List[str]] = ..., message: Optional[str] = ..., code: Optional[str] = ...
) -> None: ...
def __call__(self, value: File) -> None: ...
def __eq__(self, other: FileExtensionValidator) -> bool: ...
@@ -171,12 +132,6 @@ def validate_image_file_extension(value: File) -> None: ...
class ProhibitNullCharactersValidator:
message: Any = ...
code: str = ...
def __init__(
self, message: Optional[str] = ..., code: Optional[str] = ...
) -> None: ...
def __call__(
self, value: Optional[Union[Dict[Any, Any], str, UUID]]
) -> None: ...
def __eq__(
self, other: Union[ProhibitNullCharactersValidator, RegexValidator]
) -> bool: ...
def __init__(self, message: Optional[str] = ..., code: Optional[str] = ...) -> None: ...
def __call__(self, value: Optional[Union[Dict[Any, Any], str, UUID]]) -> None: ...
def __eq__(self, other: Union[ProhibitNullCharactersValidator, RegexValidator]) -> bool: ...

View File

@@ -2,5 +2,4 @@ from typing import Optional
from django.core.handlers.wsgi import WSGIHandler
def get_wsgi_application() -> WSGIHandler: ...