more cleanups

This commit is contained in:
Maxim Kurnikov
2018-12-22 04:42:37 +03:00
parent 59b8008a21
commit 9a2b88b270
117 changed files with 94 additions and 2798 deletions

View File

@@ -1,5 +0,0 @@
from typing import Any
VERSION: Any
def setup(set_prefix: bool = ...) -> None: ...

View File

@@ -1,21 +0,0 @@
from collections import OrderedDict
from typing import Any, Callable, Dict, Union
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 __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

@@ -1,47 +0,0 @@
from collections import OrderedDict
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 get_key_func(key_func: Optional[Union[Callable, str]]) -> Callable: ...
class BaseCache:
default_timeout: int = ...
key_prefix: str = ...
version: int = ...
key_func: Callable = ...
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 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_or_set(
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 __contains__(self, key: str) -> bool: ...
def set_many(
self,
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 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 close(self, **kwargs: Any) -> None: ...

View File

@@ -1,39 +0,0 @@
from typing import Any, Callable, Dict, Optional, Union
from django.core.cache.backends.base import BaseCache
class Options:
db_table: str = ...
app_label: str = ...
model_name: str = ...
verbose_name: str = ...
verbose_name_plural: str = ...
object_name: str = ...
abstract: bool = ...
managed: bool = ...
proxy: bool = ...
swapped: bool = ...
def __init__(self, table: str) -> None: ...
class BaseDatabaseCache(BaseCache):
default_timeout: int
key_func: Callable
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: ...
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 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 = ...) -> 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

@@ -1,19 +0,0 @@
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 delete(self, key: str, version: None = ...) -> None: ...
def has_key(self, key: str, version: None = ...) -> bool: ...
def clear(self) -> None: ...

View File

@@ -1,22 +0,0 @@
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 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 = ...) -> 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

@@ -1,26 +0,0 @@
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 add(
self,
key: str,
value: Union[Dict[str, int], Dict[str, str], bytes, int, str],
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 has_key(self, key: str, version: Optional[int] = ...) -> Any: ...
def delete(self, key: str, version: Optional[int] = ...) -> None: ...
def clear(self) -> None: ...

View File

@@ -1,5 +0,0 @@
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: ...

View File

@@ -1,7 +0,0 @@
from typing import Any, List, Optional
from django.core.checks.messages import Error
E001: Any
def check_default_cache_is_configured(app_configs: None, **kwargs: Any) -> List[Error]: ...

View File

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

View File

@@ -1,45 +0,0 @@
from typing import Any, Optional, Union
DEBUG: int
INFO: int
WARNING: int
ERROR: int
CRITICAL: int
class CheckMessage:
level: Any = ...
msg: Any = ...
hint: Any = ...
obj: Any = ...
id: Any = ...
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: ...
class Debug(CheckMessage):
def __init__(self, *args: Any, **kwargs: Any) -> None: ...
class Info(CheckMessage):
def __init__(self, *args: Any, **kwargs: Any) -> None: ...
class Warning(CheckMessage):
hint: str
id: str
level: int
msg: str
obj: Any
def __init__(self, *args: Any, **kwargs: Any) -> None: ...
class Error(CheckMessage):
hint: None
id: str
level: int
msg: str
obj: Any
def __init__(self, *args: Any, **kwargs: Any) -> None: ...
class Critical(CheckMessage):
def __init__(self, *args: Any, **kwargs: Any) -> None: ...

View File

@@ -1,6 +0,0 @@
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]: ...

View File

@@ -1,35 +0,0 @@
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 = ...
compatibility: str = ...
database: str = ...
models: str = ...
security: str = ...
signals: str = ...
templates: str = ...
urls: str = ...
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 run_checks(
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]: ...
def get_checks(self, include_deployment_checks: bool = ...) -> List[Callable]: ...
registry: Any
register: Any
run_checks: Any
tag_exists: Any

View File

@@ -1,31 +0,0 @@
from typing import Any, List, Optional
from django.core.checks.messages import Warning
SECRET_KEY_MIN_LENGTH: int
SECRET_KEY_MIN_UNIQUE_CHARACTERS: int
W001: Any
W002: Any
W004: Any
W005: Any
W006: Any
W007: Any
W008: Any
W009: Any
W018: Any
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_sts(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_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]: ...
def check_debug(app_configs: None, **kwargs: Any) -> List[Warning]: ...
def check_xframe_deny(app_configs: None, **kwargs: Any) -> List[Warning]: ...
def check_allowed_hosts(app_configs: None, **kwargs: Any) -> List[Warning]: ...

View File

@@ -1,9 +0,0 @@
from typing import Any, List, Optional
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]: ...

View File

@@ -1,18 +0,0 @@
from typing import Any, List, Optional
from django.core.checks.messages import Warning
def add_session_cookie_message(message: Any): ...
W010: Any
W011: Any
W012: Any
def add_httponly_message(message: Any): ...
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]: ...

View File

@@ -1,9 +0,0 @@
from typing import Any, List, Optional
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]: ...

View File

@@ -1,11 +0,0 @@
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 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

@@ -1,58 +0,0 @@
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): ...
class ObjectDoesNotExist(Exception):
silent_variable_failure: bool = ...
class MultipleObjectsReturned(Exception): ...
class SuspiciousOperation(Exception): ...
class SuspiciousMultipartForm(SuspiciousOperation): ...
class SuspiciousFileOperation(SuspiciousOperation): ...
class DisallowedHost(SuspiciousOperation): ...
class DisallowedRedirect(SuspiciousOperation): ...
class TooManyFieldsSent(SuspiciousOperation): ...
class RequestDataTooBig(SuspiciousOperation): ...
class PermissionDenied(Exception): ...
class ViewDoesNotExist(Exception): ...
class MiddlewareNotUsed(Exception): ...
class ImproperlyConfigured(Exception): ...
class FieldError(Exception): ...
NON_FIELD_ERRORS: str
class ValidationError(Exception):
error_dict: Any = ...
error_list: Any = ...
message: Any = ...
code: Any = ...
params: Any = ...
def __init__(
self,
message: Union[
Dict[str, List[ValidationError]],
Dict[str, ErrorList],
List[Union[ValidationError, str]],
ValidationError,
ErrorList,
str,
],
code: Optional[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]]: ...
@property
def messages(self) -> List[str]: ...
def update_error_dict(
self, error_dict: Union[Dict[str, List[ValidationError]], ErrorDict]
) -> Union[Dict[str, List[ValidationError]], ErrorDict]: ...
def __iter__(self) -> Iterator[Union[Tuple[str, List[str]], str]]: ...
class EmptyResultSet(Exception): ...

View File

@@ -1,34 +0,0 @@
from io import BufferedReader, StringIO
from typing import Any, Iterator, Optional, Union
from django.core.files.utils import FileProxyMixin
class File(FileProxyMixin):
DEFAULT_CHUNK_SIZE: Any = ...
file: StringIO = ...
name: Optional[str] = ...
mode: str = ...
def __init__(self, file: Any, name: Optional[str] = ...) -> None: ...
def __bool__(self) -> bool: ...
def __len__(self) -> int: ...
def size(self) -> int: ...
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: ...
def __exit__(self, exc_type: None, exc_value: None, tb: None) -> None: ...
def open(self, mode: Optional[str] = ...) -> File: ...
def close(self) -> None: ...
class ContentFile(File):
file: StringIO
size: Any = ...
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: ...
def write(self, data: str) -> int: ...
def endswith_cr(line: bytes) -> bool: ...
def endswith_lf(line: Union[bytes, str]) -> bool: ...
def equals_lf(line: bytes) -> bool: ...

View File

@@ -1,15 +0,0 @@
from io import BufferedReader, BytesIO
from typing import Any, Union
from django.core.files import File
class ImageFile(File):
file: BufferedReader
mode: str
name: str
@property
def width(self) -> int: ...
@property
def height(self) -> int: ...
def get_image_dimensions(file_or_path: Union[BufferedReader, BytesIO, ImageFile, str], close: bool = ...) -> Any: ...

View File

@@ -1,17 +0,0 @@
from ctypes import Structure, Union, c_int64, c_ulong, c_void_p
from io import BufferedRandom, TextIOWrapper
from typing import Any, Optional, Union
LOCK_SH: int
LOCK_NB: int
LOCK_EX: int
ULONG_PTR = c_int64
ULONG_PTR = c_ulong
PVOID = c_void_p
class _OFFSET(Structure): ...
class _OFFSET_UNION(Union): ...
class OVERLAPPED(Structure): ...
def lock(f: Union[BufferedRandom, TextIOWrapper, int], flags: int) -> bool: ...
def unlock(f: Union[BufferedRandom, int]) -> bool: ...

View File

@@ -1,5 +0,0 @@
from typing import Any, Optional
def file_move_safe(
old_file_name: str, new_file_name: str, chunk_size: int = ..., allow_overwrite: bool = ...
) -> None: ...

View File

@@ -1,51 +0,0 @@
from datetime import datetime
from io import StringIO, TextIOWrapper
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] = ...
) -> str: ...
def get_valid_name(self, name: str) -> 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: ...
def exists(self, name: Any) -> None: ...
def listdir(self, path: Any) -> None: ...
def size(self, name: Any) -> None: ...
def url(self, name: Any) -> None: ...
def get_accessed_time(self, name: Any) -> None: ...
def get_created_time(self, name: Any) -> None: ...
def get_modified_time(self, name: Any) -> None: ...
class FileSystemStorage(Storage):
def __init__(
self,
location: Optional[str] = ...,
base_url: Optional[str] = ...,
file_permissions_mode: Optional[int] = ...,
directory_permissions_mode: Optional[int] = ...,
) -> None: ...
def base_location(self) -> str: ...
def location(self) -> str: ...
def base_url(self) -> str: ...
def file_permissions_mode(self) -> Optional[int]: ...
def directory_permissions_mode(self) -> Optional[int]: ...
def delete(self, name: str) -> None: ...
def exists(self, name: str) -> bool: ...
def listdir(self, path: str) -> Tuple[List[str], List[str]]: ...
def path(self, name: str) -> str: ...
def size(self, name: str) -> int: ...
def url(self, name: Optional[str]) -> str: ...
def get_accessed_time(self, name: str) -> datetime: ...
def get_created_time(self, name: str) -> datetime: ...
def get_modified_time(self, name: str) -> datetime: ...
class DefaultStorage(LazyObject): ...
default_storage: Any

View File

@@ -1,59 +0,0 @@
from io import BytesIO, StringIO
from tempfile import _TemporaryFileWrapper
from typing import Any, Dict, Iterator, Optional, Union
from django.core.files.base import File
class UploadedFile(File):
file: None
size: Any = ...
content_type: Any = ...
charset: Any = ...
content_type_extra: Any = ...
def __init__(
self,
file: Optional[Union[BytesIO, StringIO, _TemporaryFileWrapper]] = ...,
name: str = ...,
content_type: str = ...,
size: Optional[int] = ...,
charset: Optional[str] = ...,
content_type_extra: Optional[Dict[str, bytes]] = ...,
) -> None: ...
name: Any = ...
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]] = ...,
) -> None: ...
def temporary_file_path(self) -> str: ...
def close(self) -> None: ...
class InMemoryUploadedFile(UploadedFile):
file: _io.StringIO
field_name: Any = ...
def __init__(
self,
file: Union[BytesIO, StringIO],
field_name: Optional[str],
name: str,
content_type: str,
size: int,
charset: Optional[str],
content_type_extra: Optional[Dict[str, bytes]] = ...,
) -> None: ...
def open(self, mode: Optional[str] = ...) -> InMemoryUploadedFile: ...
def chunks(self, chunk_size: None = ...) -> Iterator[Union[bytes, str]]: ...
def multiple_chunks(self, chunk_size: Optional[Any] = ...): ...
class SimpleUploadedFile(InMemoryUploadedFile):
file: _io.BytesIO
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,80 +0,0 @@
from io import BytesIO
from typing import Any, Dict, Optional, Union
from django.core.files.uploadedfile import InMemoryUploadedFile, TemporaryUploadedFile
from django.core.handlers.wsgi import WSGIRequest
class UploadFileException(Exception): ...
class StopUpload(UploadFileException):
connection_reset: bool = ...
def __init__(self, connection_reset: bool = ...) -> None: ...
class SkipFile(UploadFileException): ...
class StopFutureHandlers(UploadFileException): ...
class FileUploadHandler:
chunk_size: Any = ...
file_name: Any = ...
content_type: Any = ...
content_length: Any = ...
charset: Any = ...
content_type_extra: Any = ...
request: Any = ...
def __init__(self, request: Optional[WSGIRequest] = ...) -> None: ...
def handle_raw_input(
self,
input_data: Union[BytesIO, WSGIRequest],
META: Dict[str, Any],
content_length: int,
boundary: bytes,
encoding: str = ...,
) -> None: ...
field_name: Any = ...
def new_file(
self,
field_name: str,
file_name: str,
content_type: str,
content_length: None,
charset: None = ...,
content_type_extra: Dict[str, bytes] = ...,
) -> None: ...
def receive_data_chunk(self, raw_data: Any, start: Any) -> None: ...
def file_complete(self, file_size: Any) -> None: ...
def upload_complete(self) -> None: ...
class TemporaryFileUploadHandler(FileUploadHandler):
charset: None
content_length: None
content_type: None
content_type_extra: None
file_name: None
request: django.core.handlers.wsgi.WSGIRequest
file: Any = ...
def new_file(self, *args: Any, **kwargs: Any) -> None: ...
def receive_data_chunk(self, raw_data: bytes, start: int) -> None: ...
def file_complete(self, file_size: int) -> TemporaryUploadedFile: ...
class MemoryFileUploadHandler(FileUploadHandler):
charset: None
content_length: None
content_type: None
content_type_extra: None
file_name: None
request: django.core.handlers.wsgi.WSGIRequest
activated: Any = ...
def handle_raw_input(
self,
input_data: Union[BytesIO, WSGIRequest],
META: Dict[str, Any],
content_length: int,
boundary: bytes,
encoding: str = ...,
) -> 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 load_handler(path: str, *args: Any, **kwargs: Any) -> FileUploadHandler: ...

View File

@@ -1,23 +0,0 @@
from typing import Any, Optional
class FileProxyMixin:
encoding: Any = ...
fileno: Any = ...
flush: Any = ...
isatty: Any = ...
newlines: Any = ...
read: Any = ...
readinto: Any = ...
readline: Any = ...
readlines: Any = ...
seek: Any = ...
tell: Any = ...
truncate: Any = ...
write: Any = ...
writelines: Any = ...
@property
def closed(self) -> bool: ...
def readable(self) -> bool: ...
def writable(self) -> bool: ...
def seekable(self) -> bool: ...
def __iter__(self): ...

View File

@@ -1,15 +0,0 @@
from typing import Any, Callable, Optional
from django.core.handlers.wsgi import WSGIRequest
from django.http.response import HttpResponse, HttpResponseBase
from .exception import convert_exception_to_response, get_exception_response
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_response(self, request: WSGIRequest) -> HttpResponseBase: ...
def process_exception_by_middleware(self, exception: Exception, request: WSGIRequest) -> HttpResponse: ...

View File

@@ -1,12 +0,0 @@
from typing import Any, Callable, Optional
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 get_exception_response(
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

@@ -1,51 +0,0 @@
from io import BytesIO
from typing import Any, Callable, Dict, Optional, Union
from django.contrib.auth.models import AbstractUser
from django.contrib.sessions.backends.base import SessionBase
from django.core.handlers import base
from django.http import HttpRequest
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 read(self, size: Optional[int] = ...) -> bytes: ...
def readline(self, size: Optional[int] = ...) -> bytes: ...
class WSGIRequest(HttpRequest):
content_params: Dict[str, str]
content_type: str
environ: Dict[str, Any] = ...
path_info: str = ...
path: str = ...
user: AbstractUser
session: SessionBase
META: Dict[str, Any] = ...
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 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: ...

View File

@@ -1,48 +0,0 @@
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 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 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.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 send_mail(
subject: str,
message: str,
from_email: Optional[str],
recipient_list: List[str],
fail_silently: bool = ...,
auth_user: None = ...,
auth_password: None = ...,
connection: Optional[BaseEmailBackend] = ...,
html_message: Optional[str] = ...,
) -> int: ...
def send_mass_mail(
datatuple: List[Tuple[str, str, str, List[str]]],
fail_silently: bool = ...,
auth_user: None = ...,
auth_password: None = ...,
connection: BaseEmailBackend = ...,
) -> int: ...
def mail_admins(
subject: str,
message: str,
fail_silently: bool = ...,
connection: Optional[BaseEmailBackend] = ...,
html_message: Optional[str] = ...,
) -> None: ...
def mail_managers(
subject: str,
message: str,
fail_silently: bool = ...,
connection: Optional[BaseEmailBackend] = ...,
html_message: Optional[str] = ...,
) -> None: ...
outbox = [EmailMessage()]

View File

@@ -1,10 +0,0 @@
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 send_messages(self, email_messages: Any) -> None: ...

View File

@@ -1,11 +0,0 @@
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: ...

View File

@@ -1,8 +0,0 @@
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,13 +0,0 @@
from typing import Any, Optional
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 write_message(self, message: EmailMessage) -> None: ...
stream: None = ...
def open(self) -> bool: ...
def close(self) -> None: ...

View File

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

View File

@@ -1,37 +0,0 @@
from smtplib import SMTP
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 = ...
port: Any = ...
username: Any = ...
password: Any = ...
use_tls: Any = ...
use_ssl: Any = ...
timeout: Any = ...
ssl_keyfile: Any = ...
ssl_certfile: Any = ...
connection: Any = ...
def __init__(
self,
host: None = ...,
port: None = ...,
username: Optional[str] = ...,
password: Optional[str] = ...,
use_tls: Optional[bool] = ...,
fail_silently: bool = ...,
use_ssl: Optional[bool] = ...,
timeout: None = ...,
ssl_keyfile: Optional[str] = ...,
ssl_certfile: Optional[str] = ...,
**kwargs: Any
) -> None: ...
@property
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: ...

View File

@@ -1,119 +0,0 @@
from email.mime.message import MIMEMessage
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
from typing import Any, Dict, List, Optional, Tuple, Union
from django.core.mail.backends.base import BaseEmailBackend
utf8_charset: Any
utf8_charset_qp: Any
DEFAULT_ATTACHMENT_MIME_TYPE: str
RFC5322_EMAIL_LINE_LENGTH_LIMIT: int
class BadHeaderError(ValueError): ...
ADDRESS_HEADERS: Any
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: ...
class MIMEMixin:
def as_string(self, unixfrom: bool = ..., linesep: str = ...) -> str: ...
def as_bytes(self, unixfrom: bool = ..., linesep: str = ...) -> bytes: ...
class SafeMIMEMessage(MIMEMixin, MIMEMessage):
defects: List[Any]
epilogue: None
policy: email._policybase.Compat32
preamble: None
def __setitem__(self, name: str, val: str) -> None: ...
class SafeMIMEText(MIMEMixin, MIMEText):
defects: List[Any]
epilogue: None
policy: email._policybase.Compat32
preamble: None
encoding: str = ...
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: ...
class SafeMIMEMultipart(MIMEMixin, MIMEMultipart):
defects: List[Any]
epilogue: None
policy: email._policybase.Compat32
preamble: None
encoding: str = ...
def __init__(
self, _subtype: str = ..., boundary: None = ..., _subparts: None = ..., encoding: str = ..., **_params: Any
) -> None: ...
def __setitem__(self, name: str, val: str) -> None: ...
class EmailMessage:
content_subtype: str = ...
mixed_subtype: str = ...
encoding: Any = ...
to: List[str] = ...
cc: List[Any] = ...
bcc: List[Any] = ...
reply_to: List[Any] = ...
from_email: str = ...
subject: str = ...
body: str = ...
attachments: List[Any] = ...
extra_headers: Dict[Any, Any] = ...
connection: None = ...
def __init__(
self,
subject: str = ...,
body: Optional[str] = ...,
from_email: Optional[str] = ...,
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]]] = ...,
headers: Optional[Dict[str, str]] = ...,
cc: Optional[Union[List[str], Tuple[str, str], str]] = ...,
reply_to: Optional[Union[List[Optional[str]], str]] = ...,
) -> None: ...
def get_connection(self, fail_silently: bool = ...) -> BaseEmailBackend: ...
def message(self) -> MIMEMixin: ...
def recipients(self) -> List[str]: ...
def send(self, fail_silently: bool = ...) -> int: ...
def attach(
self,
filename: Optional[Union[MIMEText, str]] = ...,
content: Optional[Union[bytes, EmailMessage, SafeMIMEText, str]] = ...,
mimetype: Optional[str] = ...,
) -> None: ...
def attach_file(self, path: str, mimetype: Optional[str] = ...) -> None: ...
class EmailMultiAlternatives(EmailMessage):
attachments: List[Any]
bcc: List[Any]
body: django.utils.safestring.SafeText
cc: List[Any]
connection: None
extra_headers: Dict[Any, Any]
from_email: str
reply_to: List[Any]
subject: str
to: List[str]
alternative_subtype: str = ...
alternatives: Any = ...
def __init__(
self,
subject: str = ...,
body: str = ...,
from_email: Optional[str] = ...,
to: Optional[List[str]] = ...,
bcc: Optional[List[str]] = ...,
connection: Optional[BaseEmailBackend] = ...,
attachments: None = ...,
headers: Optional[Dict[str, str]] = ...,
alternatives: Optional[List[Tuple[str, str]]] = ...,
cc: None = ...,
reply_to: None = ...,
) -> None: ...
def attach_alternative(self, content: str, mimetype: str) -> None: ...

View File

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

View File

@@ -1,20 +0,0 @@
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]: ...
class ManagementUtility:
argv: List[str] = ...
prog_name: str = ...
settings_exception: None = ...
def __init__(self, argv: List[str] = ...) -> None: ...
def main_help_text(self, commands_only: bool = ...): ...
def fetch_command(self, subcommand: str) -> BaseCommand: ...
def autocomplete(self) -> None: ...
def execute(self) -> None: ...
def execute_from_command_line(argv: List[str] = ...) -> None: ...

View File

@@ -1,91 +0,0 @@
from argparse import ArgumentParser, HelpFormatter, Namespace
from io import StringIO, TextIOBase, TextIOWrapper
from typing import Any, Callable, List, Optional, Tuple, Union
from django.apps.config import AppConfig
class CommandError(Exception): ...
class SystemCheckError(CommandError): ...
class CommandParser(ArgumentParser):
add_help: bool
allow_abbrev: bool
argument_default: None
conflict_handler: str
description: str
epilog: None
formatter_class: Type[django.core.management.base.DjangoHelpFormatter]
fromfile_prefix_chars: None
prefix_chars: str
prog: str
usage: None
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 error(self, message: str) -> Any: ...
def handle_default_options(options: Namespace) -> None: ...
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_arguments(self, actions: List[Any]) -> None: ...
class OutputWrapper(TextIOBase):
@property
def style_func(self): ...
@style_func.setter
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 __getattr__(self, name: str) -> Callable: ...
def isatty(self) -> bool: ...
def write(self, msg: str, style_func: Optional[Callable] = ..., ending: Optional[str] = ...) -> None: ...
class BaseCommand:
help: str = ...
output_transaction: bool = ...
requires_migrations_checks: bool = ...
requires_system_checks: bool = ...
base_stealth_options: Any = ...
stealth_options: Any = ...
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 get_version(self) -> str: ...
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 check(
self,
app_configs: Optional[List[AppConfig]] = ...,
tags: Optional[List[str]] = ...,
display_num_errors: bool = ...,
include_deployment_checks: bool = ...,
fail_level: int = ...,
) -> None: ...
def check_migrations(self) -> None: ...
def handle(self, *args: Any, **options: Any) -> None: ...
class AppCommand(BaseCommand):
missing_args_message: str = ...
def add_arguments(self, parser: Any) -> None: ...
def handle(self, *app_labels: Any, **options: Any): ...
def handle_app_config(self, app_config: Any, **options: Any) -> None: ...
class LabelCommand(BaseCommand):
label: str = ...
missing_args_message: Any = ...
def add_arguments(self, parser: CommandParser) -> None: ...
def handle(self, *labels: Any, **options: Any) -> str: ...
def handle_label(self, label: Any, **options: Any) -> None: ...

View File

@@ -1,9 +0,0 @@
from typing import Optional
def supports_color() -> bool: ...
class Style: ...
def make_style(config_string: str = ...) -> Style: ...
def no_style(): ...
def color_style() -> Style: ...

View File

@@ -1,12 +0,0 @@
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
style: django.core.management.color.Style
help: str = ...
requires_system_checks: bool = ...
def add_arguments(self, parser: CommandParser) -> None: ...
def handle(self, *app_labels: Any, **options: Any) -> None: ...

View File

@@ -1,19 +0,0 @@
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: ...
class Command(BaseCommand):
stderr: django.core.management.base.OutputWrapper
stdout: django.core.management.base.OutputWrapper
style: django.core.management.color.Style
help: str = ...
requires_system_checks: bool = ...
program: str = ...
program_options: Any = ...
def add_arguments(self, parser: CommandParser) -> None: ...
verbosity: Any = ...
def handle(self, **options: Any) -> None: ...
def compile_messages(self, locations: List[Tuple[str, str]]) -> None: ...

View File

@@ -1,14 +0,0 @@
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
style: django.core.management.color.Style
help: str = ...
requires_system_checks: bool = ...
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: ...

View File

@@ -1,13 +0,0 @@
from typing import Any, Optional
from django.core.management.base import BaseCommand, CommandParser
class ProxyModelWarning(Warning): ...
class Command(BaseCommand):
stderr: django.core.management.base.OutputWrapper
stdout: django.core.management.base.OutputWrapper
style: django.core.management.color.Style
help: str = ...
def add_arguments(self, parser: CommandParser) -> None: ...
def handle(self, *app_labels: Any, **options: Any) -> None: ...

View File

@@ -1,12 +0,0 @@
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
help: str = ...
stealth_options: Any = ...
def add_arguments(self, parser: CommandParser) -> None: ...
style: django.core.management.color.Style = ...
def handle(self, **options: Any) -> None: ...

View File

@@ -1,31 +0,0 @@
from collections import OrderedDict
from typing import Any, Dict, Iterator, List, Optional, Tuple, Union
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
style: django.core.management.color.Style
help: str = ...
requires_system_checks: bool = ...
stealth_options: Any = ...
db_module: str = ...
def add_arguments(self, parser: CommandParser) -> None: ...
def handle(self, **options: Any) -> None: ...
def handle_inspection(self, options: Dict[str, Any]) -> Iterator[str]: ...
def normalize_col_name(
self, col_name: str, used_column_names: List[str], is_relation: bool
) -> Tuple[str, Dict[str, str], List[str]]: ...
def get_field_type(
self, connection: DatabaseWrapper, table_name: str, row: FieldInfo
) -> Tuple[str, OrderedDict, List[str]]: ...
def get_meta(
self,
table_name: str,
constraints: Dict[str, Dict[str, Union[List[str], bool]]],
column_to_field_name: Dict[str, str],
is_view: bool,
) -> List[str]: ...

View File

@@ -1,47 +0,0 @@
import zipfile
from typing import Any, List, Optional, Tuple
from django.core.management.base import BaseCommand, CommandParser
has_bz2: bool
READ_STDIN: str
class Command(BaseCommand):
stderr: django.core.management.base.OutputWrapper
stdout: django.core.management.base.OutputWrapper
style: django.core.management.color.Style
help: str = ...
missing_args_message: str = ...
def add_arguments(self, parser: CommandParser) -> None: ...
ignore: Any = ...
using: Any = ...
app_label: Any = ...
verbosity: Any = ...
format: Any = ...
def handle(self, *fixture_labels: Any, **options: Any) -> None: ...
fixture_count: int = ...
loaded_object_count: int = ...
fixture_object_count: int = ...
models: Any = ...
serialization_formats: Any = ...
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 fixture_dirs(self) -> List[str]: ...
def parse_name(self, fixture_name: str) -> Tuple[str, Optional[str], Optional[str]]: ...
class SingleZipReader(zipfile.ZipFile):
NameToInfo: Dict[str, zipfile.ZipInfo]
compression: int
debug: int
filelist: List[zipfile.ZipInfo]
filename: str
fp: _io.BufferedReader
mode: str
pwd: None
start_dir: int
def __init__(self, *args: Any, **kwargs: Any) -> None: ...
def read(self) -> bytes: ...
def humanize(dirname: str) -> str: ...

View File

@@ -1,68 +0,0 @@
from typing import Any, List, Optional, Tuple
from django.core.management.base import BaseCommand, CommandParser
plural_forms_re: Any
STATUS_OK: int
NO_LOCALE_DIR: Any
def check_programs(*programs: Any) -> None: ...
class TranslatableFile:
file: str = ...
dirpath: str = ...
locale_dir: str = ...
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
def path(self) -> str: ...
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 is_templatized(self) -> bool: ...
def path(self) -> str: ...
def work_path(self) -> str: ...
def preprocess(self) -> None: ...
def postprocess_messages(self, msgs: str) -> str: ...
def cleanup(self) -> None: ...
def normalize_eols(raw_contents: str) -> str: ...
def write_pot_file(potfile: str, msgs: str) -> None: ...
class Command(BaseCommand):
stderr: django.core.management.base.OutputWrapper
stdout: django.core.management.base.OutputWrapper
style: django.core.management.color.Style
help: str = ...
translatable_file_class: Any = ...
build_file_class: Any = ...
requires_system_checks: bool = ...
msgmerge_options: Any = ...
msguniq_options: Any = ...
msgattrib_options: Any = ...
xgettext_options: Any = ...
def add_arguments(self, parser: CommandParser) -> None: ...
domain: Any = ...
verbosity: Any = ...
symlinks: Any = ...
ignore_patterns: Any = ...
no_obsolete: Any = ...
keep_pot: Any = ...
extensions: Any = ...
invoked_for_django: bool = ...
locale_paths: Any = ...
default_locale_path: Any = ...
def handle(self, *args: Any, **options: Any) -> None: ...
def gettext_version(self) -> Tuple[int, int]: ...
def settings_available(self) -> bool: ...
def build_potfiles(self) -> List[str]: ...
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 write_po_file(self, potfile: str, locale: str) -> None: ...
def copy_plural_forms(self, msgs: str, locale: str) -> str: ...

View File

@@ -1,21 +0,0 @@
from typing import Any, Dict, List, Optional, Set
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
style: django.core.management.color.Style
help: str = ...
def add_arguments(self, parser: CommandParser) -> None: ...
verbosity: int = ...
interactive: bool = ...
dry_run: bool = ...
merge: bool = ...
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: ...

View File

@@ -1,20 +0,0 @@
from typing import Any, Optional, Set
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
style: django.core.management.color.Style
help: str = ...
def add_arguments(self, parser: CommandParser) -> None: ...
verbosity: Any = ...
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: ...

View File

@@ -1,30 +0,0 @@
from typing import Any, Optional
from django.core.handlers.wsgi import WSGIHandler
from django.core.management.base import BaseCommand, CommandParser
naiveip_re: Any
class Command(BaseCommand):
stderr: django.core.management.base.OutputWrapper
stdout: django.core.management.base.OutputWrapper
style: django.core.management.color.Style
help: str = ...
requires_system_checks: bool = ...
stealth_options: Any = ...
default_addr: str = ...
default_addr_ipv6: str = ...
default_port: str = ...
protocol: str = ...
server_cls: Any = ...
def add_arguments(self, parser: CommandParser) -> None: ...
def execute(self, *args: Any, **options: Any) -> None: ...
def get_handler(self, *args: Any, **options: Any) -> WSGIHandler: ...
use_ipv6: Any = ...
addr: str = ...
port: Any = ...
def handle(self, *args: Any, **options: Any) -> None: ...
def run(self, **options: Any) -> None: ...
def inner_run(self, *args: Any, **options: Any) -> None: ...
BaseRunserverCommand = Command

View File

@@ -1,12 +0,0 @@
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
style: django.core.management.color.Style
help: str = ...
missing_args_message: str = ...
def add_arguments(self, parser: CommandParser) -> None: ...
def handle(self, *args: Any, **kwargs: Any) -> None: ...

View File

@@ -1,17 +0,0 @@
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
style: django.core.management.color.Style
help: str = ...
requires_system_checks: bool = ...
shells: Any = ...
def add_arguments(self, parser: CommandParser) -> None: ...
def ipython(self, options: Dict[str, Optional[Union[int, str]]]) -> Any: ...
def bpython(self, options: Dict[str, Optional[Union[int, str]]]) -> Any: ...
def python(self, options: Any) -> None: ...
def handle(self, **options: Any) -> None: ...

View File

@@ -1,15 +0,0 @@
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
style: django.core.management.color.Style
help: str = ...
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: ...

View File

@@ -1,13 +0,0 @@
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
style: django.core.management.color.Style
help: str = ...
output_transaction: bool = ...
def add_arguments(self, parser: CommandParser) -> None: ...
def execute(self, *args: Any, **options: Any) -> str: ...
def handle(self, *args: Any, **options: Any) -> str: ...

View File

@@ -1,14 +0,0 @@
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
style: django.core.management.color.Style
help: str = ...
def add_arguments(self, parser: CommandParser) -> None: ...
verbosity: Any = ...
interactive: Any = ...
def handle(self, **options: Any) -> None: ...
def find_migration(self, loader: Any, app_label: Any, name: Any): ...

View File

@@ -1,2 +0,0 @@
class Command:
def handle(self, *test_labels, **options): ...

View File

@@ -1,12 +0,0 @@
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
style: django.core.management.color.Style
help: str = ...
requires_system_checks: bool = ...
def add_arguments(self, parser: CommandParser) -> None: ...
def handle(self, *fixture_labels: Any, **options: Any) -> None: ...

View File

@@ -1,14 +0,0 @@
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 = ...,
) -> 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: ...

View File

@@ -1,20 +0,0 @@
from typing import Any, Optional
from django.core.management.base import BaseCommand, CommandParser
class TemplateCommand(BaseCommand):
requires_system_checks: bool = ...
url_schemes: Any = ...
rewrite_template_suffixes: Any = ...
def add_arguments(self, parser: CommandParser) -> None: ...
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_template(self, template: Any, subdir: Any): ...
def validate_name(self, name: Any, app_or_project: Any) -> None: ...
def download(self, url: Any): ...
def splitext(self, the_path: Any): ...
def extract(self, filename: Any): ...
def is_url(self, template: Any): ...
def make_writeable(self, filename: Any) -> None: ...

View File

@@ -1,12 +0,0 @@
from typing import Any, List, Optional, Set, Tuple, Type
from django.apps.config import AppConfig
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 handle_extensions(extensions: List[str]) -> Set[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]]: ...

View File

@@ -1,52 +0,0 @@
import collections.abc
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): ...
class EmptyPage(InvalidPage): ...
class Paginator:
object_list: django.db.models.query.QuerySet = ...
per_page: int = ...
orphans: int = ...
allow_empty_first_page: bool = ...
def __init__(
self,
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 = ...,
) -> None: ...
def validate_number(self, number: Optional[Union[float, str]]) -> int: ...
def get_page(self, number: Optional[int]) -> Page: ...
def page(self, number: Union[int, str]) -> Page: ...
def count(self) -> int: ...
def num_pages(self) -> int: ...
@property
def page_range(self) -> range: ...
QuerySetPaginator = Paginator
class Page(collections.abc.Sequence):
object_list: django.db.models.query.QuerySet = ...
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,
) -> None: ...
def __len__(self) -> int: ...
def __getitem__(self, index: Union[int, str]) -> Union[Model, str]: ...
def has_next(self) -> bool: ...
def has_previous(self) -> bool: ...
def has_other_pages(self) -> bool: ...
def next_page_number(self) -> int: ...
def previous_page_number(self) -> int: ...
def start_index(self) -> int: ...
def end_index(self) -> int: ...

View File

@@ -1,30 +0,0 @@
from collections import OrderedDict
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
from django.core.serializers.xml_serializer import Deserializer
from django.db.models.base import Model
from django.db.models.query import QuerySet
BUILTIN_SERIALIZERS: Any
class BadSerializer:
internal_use_only: bool = ...
exception: ModuleNotFoundError = ...
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 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
) -> Optional[Union[List[OrderedDict], bytes, str]]: ...
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]]]]]
) -> List[Type[Model]]: ...

View File

@@ -1,85 +0,0 @@
from collections import OrderedDict
from datetime import date
from io import BufferedReader, StringIO, TextIOWrapper
from typing import Any, Dict, Iterator, List, Optional, Tuple, Type, Union
from uuid import UUID
from django.core.management.base import OutputWrapper
from django.core.serializers.xml_serializer import Deserializer
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]]
) -> 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: ...
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 update(self, count: int) -> None: ...
class Serializer:
internal_use_only: bool = ...
progress_class: Any = ...
stream_class: Any = ...
options: Any = ...
stream: Any = ...
selected_fields: Any = ...
use_natural_foreign_keys: Any = ...
use_natural_primary_keys: Any = ...
first: bool = ...
def serialize(
self,
queryset: Union[Iterator[Any], List[Model], QuerySet],
*,
stream: Optional[Any] = ...,
fields: Optional[Any] = ...,
use_natural_foreign_keys: bool = ...,
use_natural_primary_keys: bool = ...,
progress_output: Optional[Any] = ...,
object_count: int = ...,
**options: Any
) -> Optional[Union[List[OrderedDict], bytes, str]]: ...
def start_serialization(self) -> None: ...
def end_serialization(self) -> None: ...
def start_object(self, obj: Any) -> None: ...
def end_object(self, obj: Any) -> None: ...
def handle_field(self, obj: Any, field: Any) -> None: ...
def handle_fk_field(self, obj: Any, field: Any) -> None: ...
def handle_m2m_field(self, obj: Any, field: Any) -> None: ...
def getvalue(self) -> Optional[Union[bytes, str]]: ...
class Deserializer:
options: Any = ...
stream: Any = ...
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 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
) -> Optional[Union[int, str, UUID]]: ...

View File

@@ -1,32 +0,0 @@
import json
from datetime import datetime
from decimal import Decimal
from typing import Any, Optional, Union
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]]]
options: Dict[str, None]
selected_fields: None
stream: _io.StringIO
use_natural_foreign_keys: bool
use_natural_primary_keys: bool
internal_use_only: bool = ...
def start_serialization(self) -> None: ...
def end_serialization(self) -> None: ...
def end_object(self, obj: Model) -> None: ...
def getvalue(self) -> Optional[Union[bytes, str]]: ...
def Deserializer(stream_or_string: Any, **options: Any) -> None: ...
class DjangoJSONEncoder(json.JSONEncoder):
allow_nan: bool
check_circular: bool
ensure_ascii: bool
indent: None
skipkeys: bool
sort_keys: bool
def default(self, o: Union[datetime, Decimal, UUID]) -> str: ...

View File

@@ -1,38 +0,0 @@
from collections import OrderedDict
from typing import Any, Dict, Iterator, List, Optional, Union
from django.core.serializers import base
from django.core.serializers.base import DeserializedObject
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
stream: _io.StringIO
use_natural_foreign_keys: bool
use_natural_primary_keys: bool
internal_use_only: bool = ...
objects: List[Any] = ...
def start_serialization(self) -> None: ...
def end_serialization(self) -> None: ...
def start_object(self, obj: Model) -> None: ...
def end_object(self, obj: Model) -> None: ...
def get_dump_object(self, obj: Model) -> OrderedDict: ...
def handle_field(self, obj: Model, field: Field) -> None: ...
def handle_fk_field(self, obj: Model, field: ForeignKey) -> None: ...
def handle_m2m_field(self, obj: Model, field: ManyToManyField) -> None: ...
def getvalue(self) -> List[OrderedDict]: ...
def Deserializer(
object_list: Union[
List[Dict[str, Optional[Union[Dict[str, Optional[str]], str]]]],
List[Dict[str, Union[Dict[str, Union[List[int], int, str]], int, str]]],
List[OrderedDict],
],
*,
using: Any = ...,
ignorenonexistent: bool = ...,
**options: Any
) -> Iterator[DeserializedObject]: ...

View File

@@ -1,72 +0,0 @@
from collections import OrderedDict
from decimal import Decimal
from typing import Any, Optional, Union
from yaml import CSafeDumper as SafeDumper
from yaml.nodes import MappingNode, ScalarNode
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
analysis: None
anchors: Dict[Any, Any]
best_indent: int
best_line_break: str
best_width: int
canonical: None
closed: bool
column: int
default_flow_style: None
default_style: None
encoding: None
event: None
events: List[Any]
flow_level: int
indent: None
indention: bool
indents: List[Any]
last_anchor_id: int
line: int
mapping_context: bool
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]]
resolver_exact_paths: List[Any]
resolver_prefix_paths: List[Any]
root_context: bool
sequence_context: bool
serialized_nodes: Dict[Any, Any]
simple_key_context: bool
state: Callable
states: List[Any]
stream: _io.StringIO
style: None
tag_prefixes: None
use_encoding: None
use_explicit_end: None
use_explicit_start: None
use_tags: None
use_version: None
whitespace: bool
def represent_decimal(self, data: Decimal) -> ScalarNode: ...
def represent_ordered_dict(self, data: OrderedDict) -> MappingNode: ...
class Serializer(PythonSerializer):
objects: List[Any]
options: Dict[Any, Any]
selected_fields: None
stream: _io.StringIO
use_natural_foreign_keys: bool
use_natural_primary_keys: bool
internal_use_only: bool = ...
def handle_field(self, obj: Model, field: Field) -> None: ...
def end_serialization(self) -> None: ...
def getvalue(self) -> Union[bytes, str]: ...
def Deserializer(stream_or_string: str, **options: Any) -> None: ...

View File

@@ -1,78 +0,0 @@
from io import BufferedReader, TextIOWrapper
from typing import Any, Optional, Union
from xml.dom.minidom import Element
from xml.sax.expatreader import ExpatParser as _ExpatParser
from django.core.serializers import base
from django.core.serializers.base import DeserializedObject
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
stream: django.core.management.base.OutputWrapper
use_natural_foreign_keys: bool
use_natural_primary_keys: bool
def indent(self, level: int) -> None: ...
xml: django.utils.xmlutils.SimplerXMLGenerator = ...
def start_serialization(self) -> None: ...
def end_serialization(self) -> None: ...
def start_object(self, obj: Model) -> None: ...
def end_object(self, obj: Model) -> None: ...
def handle_field(self, obj: Model, field: Field) -> None: ...
def handle_fk_field(self, obj: Model, field: ForeignKey) -> None: ...
def handle_m2m_field(self, obj: Model, field: ManyToManyField) -> None: ...
class Deserializer(base.Deserializer):
options: Dict[Any, Any]
stream: _io.BufferedReader
event_stream: Any = ...
db: Any = ...
ignore: Any = ...
def __init__(
self,
stream_or_string: Union[BufferedReader, TextIOWrapper, str],
*,
using: Any = ...,
ignorenonexistent: bool = ...,
**options: Any
) -> None: ...
def __next__(self) -> DeserializedObject: ...
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 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) -> None: ...
def reset(self) -> None: ...
class DefusedXmlException(ValueError): ...
class DTDForbidden(DefusedXmlException):
name: str = ...
sysid: str = ...
pubid: None = ...
def __init__(self, name: str, sysid: str, pubid: None) -> None: ...
class EntitiesForbidden(DefusedXmlException):
name: Any = ...
value: Any = ...
base: Any = ...
sysid: Any = ...
pubid: Any = ...
notation_name: Any = ...
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: ...

View File

@@ -1,37 +0,0 @@
import socketserver
from io import BytesIO
from typing import Any, Dict
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 handle_error(self, request: Any, client_address: Any) -> None: ...
class ThreadedWSGIServer(socketserver.ThreadingMixIn, WSGIServer): ...
class ServerHandler(simple_server.ServerHandler):
http_version: str = ...
def handle_error(self) -> None: ...
class WSGIRequestHandler(simple_server.WSGIRequestHandler):
client_address: str
close_connection: bool
connection: WSGIRequest
request: WSGIRequest
rfile: BytesIO
server: None
wfile: socketserver._SocketWriter
protocol_version: str = ...
def address_string(self) -> str: ...
def log_message(self, format: str, *args: Any) -> None: ...
def get_environ(self) -> Dict[str, str]: ...
raw_requestline: bytes = ...
requestline: str = ...
request_version: str = ...
command: None = ...
def handle(self) -> None: ...

View File

@@ -1,48 +0,0 @@
from datetime import datetime
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 get_cookie_signer(salt: str = ...) -> TimestampSigner: ...
class JSONSerializer:
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(
obj: Union[Dict[str, Union[datetime, str]], List[str], str],
key: None = ...,
salt: str = ...,
serializer: Type[Union[PickleSerializer, JSONSerializer]] = ...,
compress: bool = ...,
) -> str: ...
def loads(
s: str,
key: None = ...,
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]: ...
class Signer:
key: str = ...
sep: str = ...
salt: Any = ...
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: ...
class TimestampSigner(Signer):
key: str
salt: str
sep: str
def timestamp(self) -> str: ...
def sign(self, value: str) -> str: ...
def unsign(self, value: str, max_age: Optional[int] = ...) -> str: ...

View File

@@ -1,143 +0,0 @@
from datetime import datetime
from decimal import Decimal
from re import RegexFlag
from typing import Any, Dict, List, Optional, Union
from uuid import UUID
from django.core.files.base import File
EMPTY_VALUES: Any
class RegexValidator:
regex: django.utils.functional.SimpleLazyObject = ...
message: Any = ...
code: str = ...
inverse_match: bool = ...
flags: int = ...
def __init__(
self,
regex: Optional[str] = ...,
message: Optional[str] = ...,
code: Optional[str] = ...,
inverse_match: Optional[bool] = ...,
flags: Optional[RegexFlag] = ...,
) -> None: ...
def __call__(self, value: Optional[Union[float, str]]) -> None: ...
def __eq__(self, other: Union[ProhibitNullCharactersValidator, RegexValidator]) -> bool: ...
class URLValidator(RegexValidator):
ul: str = ...
ipv4_re: str = ...
ipv6_re: str = ...
hostname_re: Any = ...
domain_re: Any = ...
tld_re: Any = ...
host_re: Any = ...
regex: django.utils.functional.SimpleLazyObject = ...
message: Any = ...
schemes: Any = ...
def __init__(self, schemes: Optional[List[str]] = ..., **kwargs: Any) -> None: ...
def __call__(self, value: str) -> None: ...
integer_validator: Any
def validate_integer(value: Optional[Union[float, str]]) -> None: ...
class EmailValidator:
message: Any = ...
code: str = ...
user_regex: Any = ...
domain_regex: Any = ...
literal_regex: Any = ...
domain_whitelist: Any = ...
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: ...
validate_email: Any
slug_re: Any
validate_slug: Any
slug_unicode_re: Any
validate_unicode_slug: Any
def validate_ipv4_address(value: str) -> None: ...
def validate_ipv6_address(value: str) -> None: ...
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: ...
validate_comma_separated_integer_list: Any
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 __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]: ...
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: ...
class MinValueValidator(BaseValidator):
limit_value: int
message: Any = ...
code: str = ...
def compare(self, a: Union[datetime, Decimal, float], b: Union[datetime, Decimal, float]) -> bool: ...
class MinLengthValidator(BaseValidator):
limit_value: int
message: Any = ...
code: str = ...
def compare(self, a: int, b: int) -> bool: ...
def clean(self, x: str) -> int: ...
class MaxLengthValidator(BaseValidator):
limit_value: int
message: Any = ...
code: str = ...
def compare(self, a: int, b: int) -> bool: ...
def clean(self, x: Union[bytes, str]) -> int: ...
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 __call__(self, value: Decimal) -> None: ...
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] = ...
) -> None: ...
def __call__(self, value: File) -> None: ...
def __eq__(self, other: FileExtensionValidator) -> bool: ...
def get_available_image_extensions() -> List[str]: ...
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: ...

View File

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

View File

@@ -5,7 +5,7 @@ from django.db.backends.base.base import BaseDatabaseWrapper
TEST_DATABASE_PREFIX: str
class BaseDatabaseCreation:
connection: django.db.backends.sqlite3.base.DatabaseWrapper = ...
connection: Any = ...
def __init__(self, connection: BaseDatabaseWrapper) -> None: ...
def create_test_db(
self, verbosity: int = ..., autoclobber: bool = ..., serialize: bool = ..., keepdb: bool = ...

View File

@@ -24,7 +24,7 @@ class BaseDatabaseOperations:
UNBOUNDED_FOLLOWING: Any = ...
CURRENT_ROW: str = ...
explain_prefix: Any = ...
connection: django.db.DefaultConnectionProxy = ...
connection: Any = ...
def __init__(self, connection: Union[DefaultConnectionProxy, BaseDatabaseWrapper]) -> None: ...
def autoinc_sql(self, table: str, column: str) -> None: ...
def bulk_batch_size(self, fields: Any, objs: Any): ...

View File

@@ -4,7 +4,7 @@ from django.db.backends.base.base import BaseDatabaseWrapper
from django.db.models.fields import Field
class BaseDatabaseValidation:
connection: django.db.backends.sqlite3.base.DatabaseWrapper = ...
connection: Any = ...
def __init__(self, connection: BaseDatabaseWrapper) -> None: ...
def check(self, **kwargs: Any) -> List[Any]: ...
def check_field(self, field: Field, **kwargs: Any) -> List[Any]: ...

View File

@@ -3,7 +3,7 @@ from typing import Any, Optional, Tuple
from django.db.backends.base.creation import BaseDatabaseCreation
class DatabaseCreation(BaseDatabaseCreation):
connection: django.db.backends.sqlite3.base.DatabaseWrapper
connection: Any
@staticmethod
def is_in_memory_db(database_name: str) -> bool: ...
def get_test_db_clone_settings(self, suffix: Any): ...

View File

@@ -3,7 +3,7 @@ from typing import Optional
from django.db.backends.base.features import BaseDatabaseFeatures
class DatabaseFeatures(BaseDatabaseFeatures):
connection: django.db.backends.sqlite3.base.DatabaseWrapper
connection: Any
can_use_chunked_reads: bool = ...
test_db_allows_multiple_connections: bool = ...
supports_unspecified_pk: bool = ...

View File

@@ -13,7 +13,7 @@ class FlexibleFieldLookupDict:
def __getitem__(self, key: str) -> Union[Tuple[str, Dict[str, int]], str]: ...
class DatabaseIntrospection(BaseDatabaseIntrospection):
connection: django.db.backends.sqlite3.base.DatabaseWrapper
connection: Any
data_types_reverse: Any = ...
def get_table_list(self, cursor: CursorWrapper) -> List[TableInfo]: ...
def get_table_description(self, cursor: CursorWrapper, table_name: str) -> List[FieldInfo]: ...

View File

@@ -12,7 +12,7 @@ from django.db.models.fields import Field
from django.utils.datastructures import ImmutableList
class DatabaseOperations(BaseDatabaseOperations):
connection: django.db.backends.sqlite3.base.DatabaseWrapper
connection: Any
cast_char_field_without_max_length: str = ...
cast_data_types: Any = ...
explain_prefix: str = ...

View File

@@ -7,7 +7,7 @@ from django.db.models.fields import Field
class DatabaseSchemaEditor(BaseDatabaseSchemaEditor):
atomic_migration: bool
collect_sql: bool
connection: django.db.backends.sqlite3.base.DatabaseWrapper
connection: Any
sql_delete_table: str = ...
sql_create_fk: Any = ...
sql_create_inline_fk: str = ...

View File

@@ -8,7 +8,7 @@ logger: Any
class CursorWrapper:
cursor: django.db.backends.sqlite3.base.SQLiteCursorWrapper = ...
db: django.db.backends.sqlite3.base.DatabaseWrapper = ...
db: Any = ...
def __init__(self, cursor: SQLiteCursorWrapper, db: DatabaseWrapper) -> None: ...
WRAP_ERROR_ATTRS: Any = ...
def __getattr__(self, attr: str) -> Union[Callable, Tuple[Tuple[str, None, None, None, None, None, None]], int]: ...
@@ -25,7 +25,7 @@ class CursorWrapper:
class CursorDebugWrapper(CursorWrapper):
cursor: django.db.backends.sqlite3.base.SQLiteCursorWrapper
db: django.db.backends.sqlite3.base.DatabaseWrapper
db: Any
def execute(self, sql: str, params: Optional[Union[List[str], Tuple]] = ...) -> Any: ...
def executemany(self, sql: str, param_list: Iterator[Any]) -> Any: ...

View File

@@ -86,7 +86,7 @@ class Options:
parents: collections.OrderedDict = ...
auto_created: bool = ...
related_fkey_lookups: List[Any] = ...
apps: django.apps.registry.Apps = ...
apps: Apps = ...
default_related_name: None = ...
def __init__(
self,
@@ -104,7 +104,7 @@ class Options:
@property
def installed(self): ...
model: Type[django.db.models.base.Model] = ...
original_attrs: Dict[str, Union[List[str], django.apps.registry.Apps, str]] = ...
original_attrs: Dict[str, Union[List[str], Apps, str]] = ...
def contribute_to_class(self, cls: Type[Model], name: str) -> None: ...
def add_manager(self, manager: Manager) -> None: ...
def add_field(self, field: Union[GenericForeignKey, Field], private: bool = ...) -> None: ...

View File

@@ -21,9 +21,7 @@ class WhereNode(tree.Node):
resolved: bool = ...
conditional: bool = ...
def split_having(self, negated: bool = ...) -> Tuple[Optional[WhereNode], Optional[WhereNode]]: ...
def as_sql(
self, compiler: SQLCompiler, connection: Union[DefaultConnectionProxy, DatabaseWrapper]
) -> Tuple[str, List[Union[int, str]]]: ...
def as_sql(self, compiler: SQLCompiler, connection: Any) -> Tuple[str, List[Union[int, str]]]: ...
def get_group_by_cols(self) -> List[Expression]: ...
def get_source_expressions(self) -> List[FieldGetDbPrepValueMixin]: ...
children: List[Union[django.db.models.lookups.BuiltinLookup, django.db.models.sql.where.WhereNode]] = ...
@@ -39,9 +37,7 @@ class WhereNode(tree.Node):
class NothingNode:
contains_aggregate: bool = ...
def as_sql(
self, compiler: SQLCompiler = ..., connection: Union[DefaultConnectionProxy, DatabaseWrapper] = ...
) -> Any: ...
def as_sql(self, compiler: SQLCompiler = ..., connection: Any = ...) -> Any: ...
class ExtraWhere:
contains_aggregate: bool = ...

View File

@@ -20,7 +20,7 @@ class ProgrammingError(DatabaseError): ...
class NotSupportedError(DatabaseError): ...
class DatabaseErrorWrapper:
wrapper: django.db.backends.sqlite3.base.DatabaseWrapper = ...
wrapper: Any = ...
def __init__(self, wrapper: DatabaseWrapper) -> None: ...
def __enter__(self) -> None: ...
def __exit__(self, exc_type: None, exc_value: None, traceback: None) -> None: ...

View File

@@ -1,24 +0,0 @@
from django.http.cookie import SimpleCookie as SimpleCookie, parse_cookie as parse_cookie
from django.http.request import (
HttpRequest as HttpRequest,
QueryDict as QueryDict,
RawPostDataException as RawPostDataException,
UnreadablePostError as UnreadablePostError,
)
from django.http.response import (
BadHeaderError as BadHeaderError,
FileResponse as FileResponse,
Http404 as Http404,
HttpResponse as HttpResponse,
HttpResponseBadRequest as HttpResponseBadRequest,
HttpResponseForbidden as HttpResponseForbidden,
HttpResponseGone as HttpResponseGone,
HttpResponseNotAllowed as HttpResponseNotAllowed,
HttpResponseNotFound as HttpResponseNotFound,
HttpResponseNotModified as HttpResponseNotModified,
HttpResponsePermanentRedirect as HttpResponsePermanentRedirect,
HttpResponseRedirect as HttpResponseRedirect,
HttpResponseServerError as HttpResponseServerError,
JsonResponse as JsonResponse,
StreamingHttpResponse as StreamingHttpResponse,
)

View File

@@ -1,5 +0,0 @@
from typing import Any, Dict
SimpleCookie: Any
def parse_cookie(cookie: str) -> Dict[str, str]: ...

View File

@@ -1,53 +0,0 @@
from io import BytesIO, StringIO
from typing import Any, Dict, Iterator, List, Optional, Tuple, Union
from django.core.handlers.wsgi import WSGIRequest
from django.http.request import QueryDict
from django.utils.datastructures import ImmutableList, MultiValueDict
class MultiPartParserError(Exception): ...
class InputStreamExhausted(Exception): ...
class MultiPartParser:
def __init__(
self,
META: Dict[str, Any],
input_data: Union[BytesIO, StringIO, WSGIRequest],
upload_handlers: Union[List[Any], ImmutableList],
encoding: Optional[str] = ...,
) -> None: ...
def parse(self) -> Tuple[QueryDict, MultiValueDict]: ...
def handle_file_complete(self, old_field_name: str, counters: List[int]) -> None: ...
def IE_sanitize(self, filename: str) -> str: ...
class LazyStream:
length: None = ...
position: int = ...
def __init__(self, producer: Union[BoundaryIter, ChunkIter], length: None = ...) -> None: ...
def tell(self): ...
def read(self, size: Optional[int] = ...) -> bytes: ...
def __next__(self) -> bytes: ...
def close(self) -> None: ...
def __iter__(self) -> LazyStream: ...
def unget(self, bytes: bytes) -> None: ...
class ChunkIter:
flo: Union[_io.BytesIO, django.core.handlers.wsgi.WSGIRequest] = ...
chunk_size: int = ...
def __init__(self, flo: Union[BytesIO, WSGIRequest], chunk_size: int = ...) -> None: ...
def __next__(self) -> bytes: ...
def __iter__(self): ...
class InterBoundaryIter:
def __init__(self, stream: LazyStream, boundary: bytes) -> None: ...
def __iter__(self) -> InterBoundaryIter: ...
def __next__(self) -> LazyStream: ...
class BoundaryIter:
def __init__(self, stream: LazyStream, boundary: bytes) -> None: ...
def __iter__(self): ...
def __next__(self) -> bytes: ...
class Parser:
def __init__(self, stream: LazyStream, boundary: bytes) -> None: ...
def __iter__(self) -> Iterator[Tuple[str, Dict[str, Tuple[str, Dict[str, Union[bytes, str]]]], LazyStream]]: ...

View File

@@ -1,99 +0,0 @@
from io import BytesIO
from typing import Any, Dict, Iterator, List, Optional, Tuple, Union, Callable
from django.contrib.sessions.backends.db import SessionStore
from django.core.handlers.wsgi import WSGIRequest
from django.utils.datastructures import MultiValueDict
RAISE_ERROR: Any
host_validation_re: Any
class UnreadablePostError(IOError): ...
class RawPostDataException(Exception): ...
class HttpRequest:
csrf_cookie_needs_reset: bool
csrf_processing_done: bool
get_host: Callable
sensitive_post_parameters: str
session: SessionStore
GET: Union[Dict[str, str], QueryDict] = ...
POST: Union[Dict[str, str], QueryDict] = ...
COOKIES: Dict[str, str] = ...
META: Dict[str, Union[int, str]] = ...
FILES: MultiValueDict = ...
path: str = ...
path_info: str = ...
method: Optional[str] = ...
resolver_match: None = ...
content_type: None = ...
content_params: None = ...
def __init__(self) -> None: ...
def get_host(self) -> str: ...
def get_port(self) -> str: ...
def get_full_path(self, force_append_slash: bool = ...) -> str: ...
def get_full_path_info(self, force_append_slash: bool = ...) -> str: ...
def get_signed_cookie(
self, key: str, default: Any = ..., salt: str = ..., max_age: Optional[int] = ...
) -> Optional[str]: ...
def get_raw_uri(self) -> str: ...
def build_absolute_uri(self, location: Optional[str] = ...) -> str: ...
@property
def scheme(self) -> Optional[str]: ...
def is_secure(self) -> bool: ...
def is_ajax(self) -> bool: ...
@property
def encoding(self): ...
@encoding.setter
def encoding(self, val: Any) -> None: ...
@property
def upload_handlers(self): ...
@upload_handlers.setter
def upload_handlers(self, upload_handlers: Any) -> None: ...
upload_handlers: Any = ...
def parse_file_upload(
self, META: Dict[str, Any], post_data: Union[BytesIO, WSGIRequest]
) -> Tuple[QueryDict, MultiValueDict]: ...
@property
def body(self) -> bytes: ...
def close(self) -> None: ...
def read(self, *args: Any, **kwargs: Any) -> bytes: ...
def readline(self, *args: Any, **kwargs: Any) -> bytes: ...
def __iter__(self) -> Iterator[bytes]: ...
def xreadlines(self) -> None: ...
def readlines(self): ...
class QueryDict(MultiValueDict):
encoding: Any = ...
def __init__(
self, query_string: Optional[Union[bytes, str]] = ..., mutable: bool = ..., encoding: Optional[str] = ...
) -> None: ...
@classmethod
def fromkeys(
cls,
iterable: Union[List[bytes], List[str], int, str],
value: Union[bytes, str] = ...,
mutable: bool = ...,
encoding: Optional[str] = ...,
) -> QueryDict: ...
@property
def encoding(self): ...
@encoding.setter
def encoding(self, value: Any) -> None: ...
def __setitem__(self, key: str, value: Optional[Union[int, str]]) -> None: ...
def __delitem__(self, key: str) -> None: ...
def __copy__(self) -> QueryDict: ...
def __deepcopy__(self, memo: Dict[Any, Any]) -> QueryDict: ...
def setlist(self, key: str, list_: List[str]) -> None: ...
def setlistdefault(self, key: str, default_list: None = ...) -> List[str]: ...
def appendlist(self, key: Union[bytes, str], value: Union[List[str], bytes, str]) -> None: ...
def pop(self, key: str, *args: Any) -> Optional[Union[List[str], str]]: ...
def popitem(self) -> Any: ...
def clear(self) -> None: ...
def setdefault(self, key: str, default: str = ...) -> str: ...
def copy(self) -> QueryDict: ...
def urlencode(self, safe: Optional[str] = ...) -> str: ...
def bytes_to_text(s: Optional[Union[bytes, int, str]], encoding: str) -> Optional[Union[int, str]]: ...
def split_domain_port(host: str) -> Tuple[str, str]: ...
def validate_host(host: str, allowed_hosts: Union[List[str], str]) -> bool: ...

View File

@@ -1,264 +0,0 @@
import functools
import io
import tempfile
from datetime import datetime
from io import BufferedReader, BytesIO
from tempfile import _TemporaryFileWrapper
from typing import Any, Dict, List, Optional, Tuple, Type, Union
from http import cookies
from django.core.files.base import ContentFile
from django.core.handlers.wsgi import WSGIRequest
from django.core.serializers.json import DjangoJSONEncoder
from django.template import Template
from django.template.context import Context
from django.test import Client
from django.test.client import FakePayload
from django.urls import ResolverMatch
class BadHeaderError(ValueError): ...
class HttpResponseBase:
status_code: int = ...
cookies: cookies.SimpleCookie = ...
closed: bool = ...
def __init__(
self,
content_type: Optional[str] = ...,
status: Any = ...,
reason: Optional[str] = ...,
charset: Optional[str] = ...,
) -> None: ...
@property
def reason_phrase(self): ...
@reason_phrase.setter
def reason_phrase(self, value: Any) -> None: ...
@property
def charset(self): ...
@charset.setter
def charset(self, value: Any) -> None: ...
def serialize_headers(self) -> bytes: ...
__bytes__: Any = ...
def __setitem__(self, header: Union[bytes, str], value: Union[bytes, int, str]) -> None: ...
def __delitem__(self, header: str) -> None: ...
def __getitem__(self, header: str) -> str: ...
def has_header(self, header: str) -> bool: ...
__contains__: Any = ...
def items(self): ...
def get(self, header: str, alternate: Optional[Union[Tuple, str]] = ...) -> Optional[Union[Tuple, str]]: ...
def set_cookie(
self,
key: str,
value: str = ...,
max_age: Optional[int] = ...,
expires: Optional[Union[datetime, str]] = ...,
path: str = ...,
domain: Optional[str] = ...,
secure: Optional[bool] = ...,
httponly: Optional[bool] = ...,
samesite: Optional[str] = ...,
) -> None: ...
def setdefault(self, key: str, value: str) -> None: ...
def set_signed_cookie(self, key: str, value: str, salt: str = ..., **kwargs: Any) -> None: ...
def delete_cookie(self, key: str, path: str = ..., domain: Optional[str] = ...) -> None: ...
def make_bytes(self, value: Union[bytes, int, str]) -> bytes: ...
def close(self) -> None: ...
def write(self, content: str) -> Any: ...
def flush(self) -> None: ...
def tell(self) -> Any: ...
def readable(self) -> bool: ...
def seekable(self) -> bool: ...
def writable(self) -> bool: ...
def writelines(self, lines: List[str]) -> Any: ...
class HttpResponse(HttpResponseBase):
client: Client
closed: bool
context: Optional[Context]
cookies: cookies.SimpleCookie
csrf_cookie_set: bool
json: functools.partial
redirect_chain: List[Tuple[str, int]]
request: Dict[str, Union[FakePayload, int, str]]
resolver_match: ResolverMatch
sameorigin: bool
status_code: int
templates: List[Template]
test_server_port: str
test_was_secure_request: bool
wsgi_request: WSGIRequest
xframe_options_exempt: bool
streaming: bool = ...
content: Any = ...
def __init__(self, content: Any = ..., *args: Any, **kwargs: Any) -> None: ...
def serialize(self): ...
__bytes__: Any = ...
@property
def content(self): ...
@content.setter
def content(self, value: Any) -> None: ...
def __iter__(self): ...
def write(self, content: Union[bytes, str]) -> None: ...
def tell(self) -> int: ...
def getvalue(self) -> bytes: ...
def writable(self) -> bool: ...
def writelines(self, lines: List[str]) -> None: ...
class StreamingHttpResponse(HttpResponseBase):
client: Client
closed: bool
context: None
cookies: cookies.SimpleCookie
json: functools.partial
request: Dict[str, Union[FakePayload, int, str]]
resolver_match: ResolverMatch
status_code: int
templates: List[Any]
wsgi_request: WSGIRequest
streaming: bool = ...
streaming_content: Any = ...
def __init__(self, streaming_content: Any = ..., *args: Any, **kwargs: Any) -> None: ...
@property
def content(self) -> Any: ...
@property
def streaming_content(self): ...
@streaming_content.setter
def streaming_content(self, value: Any) -> None: ...
def __iter__(self) -> map: ...
def getvalue(self) -> bytes: ...
class FileResponse(StreamingHttpResponse):
client: Client
closed: bool
context: None
cookies: cookies.SimpleCookie
file_to_stream: Optional[Union[io.BufferedReader, io.BytesIO, ContentFile, tempfile._TemporaryFileWrapper]]
json: functools.partial
request: Dict[str, str]
resolver_match: ResolverMatch
templates: List[Any]
wsgi_request: WSGIRequest
block_size: int = ...
as_attachment: bool = ...
filename: str = ...
def __init__(self, *args: Any, as_attachment: bool = ..., filename: str = ..., **kwargs: Any) -> None: ...
def set_headers(self, filelike: Union[BufferedReader, BytesIO, ContentFile, _TemporaryFileWrapper]) -> None: ...
class HttpResponseRedirectBase(HttpResponse):
allowed_schemes: Any = ...
def __init__(self, redirect_to: str, *args: Any, **kwargs: Any) -> None: ...
url: Any = ...
class HttpResponseRedirect(HttpResponseRedirectBase):
client: Client
closed: bool
context: Optional[Context]
cookies: cookies.SimpleCookie
csrf_cookie_set: bool
json: functools.partial
redirect_chain: List[Tuple[str, int]]
request: Dict[str, Union[Dict[str, str], FakePayload, int, str]]
resolver_match: ResolverMatch
templates: List[Template]
wsgi_request: WSGIRequest
status_code: int = ...
class HttpResponsePermanentRedirect(HttpResponseRedirectBase):
client: Client
closed: bool
context: None
cookies: cookies.SimpleCookie
json: functools.partial
redirect_chain: List[Tuple[str, int]]
request: Dict[str, str]
resolver_match: ResolverMatch
templates: List[Any]
wsgi_request: WSGIRequest
status_code: int = ...
class HttpResponseNotModified(HttpResponse):
closed: bool
cookies: cookies.SimpleCookie
wsgi_request: WSGIRequest
status_code: int = ...
def __init__(self, *args: Any, **kwargs: Any) -> None: ...
def content(self, value: Any) -> None: ...
class HttpResponseBadRequest(HttpResponse):
closed: bool
cookies: cookies.SimpleCookie
wsgi_request: WSGIRequest
status_code: int = ...
class HttpResponseNotFound(HttpResponse):
client: Client
closed: bool
context: Optional[Context]
cookies: cookies.SimpleCookie
csrf_cookie_set: bool
json: functools.partial
request: Dict[str, str]
resolver_match: ResolverMatch
templates: List[Template]
wsgi_request: WSGIRequest
status_code: int = ...
class HttpResponseForbidden(HttpResponse):
client: Client
closed: bool
context: Optional[Context]
cookies: cookies.SimpleCookie
csrf_cookie_set: bool
json: functools.partial
request: Dict[str, Union[FakePayload, int, str]]
resolver_match: ResolverMatch
templates: List[Template]
wsgi_request: WSGIRequest
status_code: int = ...
class HttpResponseNotAllowed(HttpResponse):
closed: bool
cookies: cookies.SimpleCookie
status_code: int = ...
def __init__(self, permitted_methods: Union[List[str], Tuple[str, str]], *args: Any, **kwargs: Any) -> None: ...
class HttpResponseGone(HttpResponse):
closed: bool
cookies: cookies.SimpleCookie
wsgi_request: WSGIRequest
status_code: int = ...
class HttpResponseServerError(HttpResponse):
client: Client
closed: bool
context: Context
cookies: cookies.SimpleCookie
csrf_cookie_set: bool
json: functools.partial
request: Dict[str, str]
resolver_match: ResolverMatch
templates: List[Template]
wsgi_request: WSGIRequest
status_code: int = ...
class Http404(Exception): ...
class JsonResponse(HttpResponse):
client: Client
closed: bool
context: None
cookies: cookies.SimpleCookie
json: functools.partial
request: Dict[str, Union[FakePayload, int, str]]
resolver_match: ResolverMatch
status_code: int
templates: List[Any]
wsgi_request: WSGIRequest
def __init__(
self,
data: Any,
encoder: Type[DjangoJSONEncoder] = ...,
safe: bool = ...,
json_dumps_params: Optional[Dict[str, int]] = ...,
**kwargs: Any
) -> None: ...

Some files were not shown because too many files have changed in this diff Show More