initial commit

This commit is contained in:
Maxim Kurnikov
2018-07-29 18:12:23 +03:00
commit a9f215bf64
311 changed files with 13433 additions and 0 deletions
+23
View File
@@ -0,0 +1,23 @@
from collections import OrderedDict
from django.core.cache.backends.base import BaseCache
from typing import (
Callable,
Dict,
Union,
)
def _create_cache(backend: str, **kwargs) -> BaseCache: ...
def close_caches(**kwargs) -> None: ...
class CacheHandler:
def __getitem__(self, alias: str) -> BaseCache: ...
class DefaultCacheProxy:
def __contains__(self, key: str) -> bool: ...
def __getattr__(self, name: str) -> Union[OrderedDict, Callable, Dict[str, float]]: ...
def __setattr__(self, name: str, value: Callable) -> None: ...
+43
View File
@@ -0,0 +1,43 @@
from collections import OrderedDict
from typing import (
Any,
Callable,
Dict,
List,
Optional,
Union,
)
def default_key_func(key: Union[str, int], key_prefix: str, version: Union[str, int]) -> str: ...
def get_key_func(key_func: Optional[Union[str, Callable]]) -> Callable: ...
class BaseCache:
def __contains__(self, key: str) -> bool: ...
def __init__(self, params: Dict[str, Any]) -> None: ...
def close(self, **kwargs) -> None: ...
def decr(self, key: str, delta: int = ..., version: Optional[int] = ...) -> int: ...
def decr_version(self, key: str, delta: int = ..., version: Optional[int] = ...) -> int: ...
def delete_many(self, keys: List[str], version: None = ...) -> None: ...
def get_backend_timeout(self, timeout: object = ...) -> Optional[float]: ...
def get_many(self, keys: List[str], version: Optional[int] = ...) -> Dict[str, Union[str, int]]: ...
def get_or_set(
self,
key: str,
default: Optional[Union[str, Callable, int]],
timeout: object = ...,
version: Optional[int] = ...
) -> Optional[Union[str, int]]: ...
def incr(self, key: str, delta: int = ..., version: Optional[int] = ...) -> int: ...
def incr_version(self, key: str, delta: int = ..., version: Optional[int] = ...) -> int: ...
def make_key(self, key: Union[str, int], version: Optional[Union[str, int]] = ...) -> str: ...
def set_many(
self,
data: Union[Dict[str, str], Dict[str, Union[Dict[str, int], str]], Dict[str, int], OrderedDict],
timeout: object = ...,
version: Optional[int] = ...
) -> List[Any]: ...
def validate_key(self, key: str) -> None: ...
+35
View File
@@ -0,0 +1,35 @@
from datetime import datetime
from django.db.backends.utils import CursorWrapper
from typing import (
Any,
Callable,
Dict,
Optional,
Union,
)
class BaseDatabaseCache:
def __init__(self, table: str, params: Dict[str, Union[int, Callable, str, Dict[str, int]]]) -> None: ...
class DatabaseCache:
def _base_set(self, mode: str, key: str, value: Any, timeout: object = ...): ...
def _cull(self, db: str, cursor: CursorWrapper, now: datetime) -> None: ...
def add(
self,
key: str,
value: Union[str, bytes, Dict[str, int], int],
timeout: object = ...,
version: Optional[int] = ...
) -> bool: ...
def clear(self) -> None: ...
def delete(self, key: str, version: Optional[int] = ...) -> None: ...
def get(self, key: str, default: Optional[Union[str, int]] = ..., version: Optional[int] = ...) -> Any: ...
def has_key(self, key: str, version: Optional[int] = ...): ...
def set(self, key: str, value: Any, timeout: object = ..., version: Optional[int] = ...) -> None: ...
def touch(self, key: str, timeout: Optional[int] = ..., version: None = ...) -> bool: ...
class Options:
def __init__(self, table: str) -> None: ...
+20
View File
@@ -0,0 +1,20 @@
from typing import (
Any,
Dict,
Optional,
Union,
)
class DummyCache:
def __init__(self, host: str, *args, **kwargs) -> None: ...
def add(self, key: str, value: str, timeout: object = ..., version: None = ...) -> bool: ...
def get(self, key: str, default: Optional[str] = ..., version: Optional[int] = ...) -> Optional[str]: ...
def has_key(self, key: str, version: None = ...) -> bool: ...
def set(
self,
key: str,
value: Union[str, int, Dict[str, Any]],
timeout: object = ...,
version: Optional[str] = ...
) -> None: ...
+44
View File
@@ -0,0 +1,44 @@
from io import (
BufferedRandom,
BufferedReader,
BufferedWriter,
)
from typing import (
Any,
Callable,
Dict,
List,
Optional,
Union,
)
def _write_content(f: Union[BufferedRandom, BufferedWriter], expiry: float, value: Any) -> None: ...
class FileBasedCache:
def __init__(self, dir: str, params: Dict[str, Union[Callable, int]]) -> None: ...
def _createdir(self) -> None: ...
def _cull(self) -> None: ...
def _delete(self, fname: str) -> None: ...
def _is_expired(self, f: BufferedReader) -> bool: ...
def _key_to_file(self, key: str, version: Optional[int] = ...) -> str: ...
def _list_cache_files(self) -> List[str]: ...
def add(
self,
key: str,
value: Union[str, bytes, int],
timeout: object = ...,
version: Optional[int] = ...
) -> bool: ...
def clear(self) -> None: ...
def delete(self, key: str, version: Optional[int] = ...) -> None: ...
def get(
self,
key: str,
default: Optional[Union[str, int]] = ...,
version: Optional[int] = ...
) -> Optional[str]: ...
def has_key(self, key: str, version: Optional[int] = ...) -> bool: ...
def set(self, key: str, value: Any, timeout: object = ..., version: Optional[int] = ...) -> None: ...
def touch(self, key: str, timeout: object = ..., version: None = ...): ...
+38
View File
@@ -0,0 +1,38 @@
from typing import (
Any,
Dict,
Optional,
Union,
)
class LocMemCache:
def __init__(self, name: str, params: Dict[str, Any]) -> None: ...
def _delete(self, key: str) -> None: ...
def _has_expired(self, key: str) -> bool: ...
def _set(self, key: str, value: bytes, timeout: object = ...) -> None: ...
def add(
self,
key: str,
value: Union[int, Dict[str, int], str, Dict[str, str]],
timeout: object = ...,
version: Optional[int] = ...
): ...
def clear(self) -> None: ...
def delete(self, key: str, version: Optional[int] = ...) -> None: ...
def get(
self,
key: Union[str, int],
default: Optional[Union[str, int]] = ...,
version: Optional[int] = ...
) -> Any: ...
def has_key(self, key: str, version: Optional[int] = ...): ...
def incr(self, key: Union[str, int], delta: int = ..., version: Optional[int] = ...) -> int: ...
def set(
self,
key: Union[str, int],
value: Any,
timeout: object = ...,
version: Optional[int] = ...
) -> None: ...
def touch(self, key: str, timeout: object = ..., version: None = ...): ...
+8
View File
@@ -0,0 +1,8 @@
from typing import (
List,
Optional,
Union,
)
def make_template_fragment_key(fragment_name: str, vary_on: Optional[Union[List[int], List[str]]] = ...) -> str: ...
+5
View File
@@ -0,0 +1,5 @@
from django.core.checks.messages import Error
from typing import List
def check_default_cache_is_configured(app_configs: None, **kwargs) -> List[Error]: ...
+31
View File
@@ -0,0 +1,31 @@
from typing import (
Any,
Optional,
)
class CheckMessage:
def __eq__(self, other: CheckMessage) -> bool: ...
def __init__(
self,
level: int,
msg: str,
hint: Optional[str] = ...,
obj: Any = ...,
id: Optional[str] = ...
) -> None: ...
def __str__(self) -> str: ...
def is_serious(self, level: int = ...) -> bool: ...
def is_silenced(self) -> bool: ...
class Critical:
def __init__(self, *args, **kwargs) -> None: ...
class Error:
def __init__(self, *args, **kwargs) -> None: ...
class Warning:
def __init__(self, *args, **kwargs) -> None: ...
+24
View File
@@ -0,0 +1,24 @@
from django.apps.registry import Apps
from django.core.checks.messages import (
Error,
Warning,
)
from typing import (
Any,
List,
Optional,
Set,
Tuple,
)
def _check_lazy_references(
apps: Apps,
ignore: Optional[Set[Tuple[str, str]]] = ...
) -> List[Error]: ...
def check_all_models(app_configs: None = ..., **kwargs) -> List[Warning]: ...
def check_lazy_references(app_configs: None = ..., **kwargs) -> List[Any]: ...
+20
View File
@@ -0,0 +1,20 @@
from django.core.checks.messages import Warning
from typing import (
Callable,
List,
Optional,
Union,
)
class CheckRegistry:
def __init__(self) -> None: ...
def get_checks(self, include_deployment_checks: bool = ...) -> List[Callable]: ...
def register(self, check: Union[str, Callable] = ..., *tags, **kwargs) -> Callable: ...
def run_checks(
self,
app_configs: None = ...,
tags: Optional[List[str]] = ...,
include_deployment_checks: bool = ...
) -> Union[List[str], List[Warning], List[int]]: ...
def tag_exists(self, tag: str, include_deployment_checks: bool = ...) -> bool: ...
+35
View File
@@ -0,0 +1,35 @@
from django.core.checks.messages import Warning
from typing import (
Any,
List,
)
def _security_middleware() -> bool: ...
def _xframe_middleware() -> bool: ...
def check_content_type_nosniff(app_configs: None, **kwargs) -> List[Warning]: ...
def check_debug(app_configs: None, **kwargs) -> List[Any]: ...
def check_secret_key(app_configs: None, **kwargs) -> List[Warning]: ...
def check_security_middleware(app_configs: None, **kwargs) -> List[Warning]: ...
def check_ssl_redirect(app_configs: None, **kwargs) -> List[Warning]: ...
def check_sts(app_configs: None, **kwargs) -> List[Warning]: ...
def check_xframe_deny(app_configs: None, **kwargs) -> List[Warning]: ...
def check_xss_filter(app_configs: None, **kwargs) -> List[Warning]: ...
+8
View File
@@ -0,0 +1,8 @@
from django.core.checks.messages import Warning
from typing import List
def _csrf_middleware() -> bool: ...
def check_csrf_middleware(app_configs: None, **kwargs) -> List[Warning]: ...
+13
View File
@@ -0,0 +1,13 @@
from typing import (
Any,
List,
)
def _session_app() -> bool: ...
def _session_middleware() -> bool: ...
def check_session_cookie_secure(app_configs: None, **kwargs) -> List[Any]: ...
+11
View File
@@ -0,0 +1,11 @@
from django.core.checks.messages import Error
from typing import (
Any,
List,
)
def check_setting_app_dirs_loaders(app_configs: None, **kwargs) -> List[Any]: ...
def check_string_if_invalid_is_string(app_configs: None, **kwargs) -> List[Error]: ...
+38
View File
@@ -0,0 +1,38 @@
from django.core.checks.messages import (
Error,
Warning,
)
from django.urls.resolvers import (
URLPattern,
URLResolver,
)
from typing import (
Any,
Callable,
List,
Tuple,
Union,
)
def E006(name: str) -> Error: ...
def _load_all_namespaces(resolver: URLResolver, parents: Tuple = ...) -> List[str]: ...
def check_resolver(
resolver: Union[URLResolver, URLPattern]
) -> Union[List[Error], List[Warning]]: ...
def check_url_config(app_configs: None, **kwargs) -> List[Warning]: ...
def check_url_namespaces_unique(app_configs: None, **kwargs) -> List[Any]: ...
def check_url_settings(app_configs: None, **kwargs) -> List[Error]: ...
def get_warning_for_invalid_pattern(pattern: Tuple[str, Callable]) -> List[Error]: ...
+24
View File
@@ -0,0 +1,24 @@
from django.forms.utils import ErrorDict
from typing import (
Any,
Dict,
Iterator,
List,
Optional,
Tuple,
Union,
)
class ValidationError:
def __init__(self, message: Any, code: Optional[str] = ..., params: Any = ...) -> None: ...
def __iter__(self) -> Iterator[Union[str, Tuple[str, List[str]]]]: ...
def __str__(self) -> str: ...
@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]: ...
+36
View File
@@ -0,0 +1,36 @@
from typing import (
Any,
Iterator,
Optional,
Union,
)
def endswith_cr(line: bytes) -> bool: ...
def endswith_lf(line: Union[str, bytes]) -> bool: ...
def equals_lf(line: bytes) -> bool: ...
class ContentFile:
def __bool__(self) -> bool: ...
def __init__(self, content: Union[str, bytes], name: Optional[str] = ...) -> None: ...
def close(self) -> None: ...
class File:
def __bool__(self) -> bool: ...
def __enter__(self) -> File: ...
def __exit__(self, exc_type: None, exc_value: None, tb: None) -> None: ...
def __init__(self, file: Any, name: Optional[str] = ...) -> None: ...
def __iter__(self) -> Iterator[Union[str, bytes]]: ...
def __len__(self) -> int: ...
def __repr__(self) -> str: ...
def __str__(self) -> str: ...
def chunks(self, chunk_size: None = ...) -> Iterator[Union[str, bytes]]: ...
def close(self) -> None: ...
@cached_property
def size(self) -> int: ...
+11
View File
@@ -0,0 +1,11 @@
from io import BufferedRandom
from typing import Union
def _fd(f: Union[BufferedRandom, int]) -> int: ...
def lock(f: Union[BufferedRandom, int], flags: int) -> bool: ...
def unlock(f: int) -> bool: ...
+9
View File
@@ -0,0 +1,9 @@
def _samefile(src: str, dst: str) -> bool: ...
def file_move_safe(
old_file_name: str,
new_file_name: str,
chunk_size: int = ...,
allow_overwrite: bool = ...
) -> None: ...
+67
View File
@@ -0,0 +1,67 @@
from io import StringIO
from datetime import datetime
from django.core.files.base import File
from typing import (
Any,
List,
Optional,
Tuple,
Union,
)
def get_storage_class(import_path: Optional[str] = ...) -> Any: ...
class FileSystemStorage:
def __init__(
self,
location: Optional[str] = ...,
base_url: Optional[str] = ...,
file_permissions_mode: Optional[int] = ...,
directory_permissions_mode: Optional[int] = ...
) -> None: ...
def _clear_cached_properties(self, setting: str, **kwargs) -> None: ...
def _datetime_from_timestamp(self, ts: float) -> datetime: ...
def _open(self, name: str, mode: str = ...) -> File: ...
def _save(self, name: str, content: File) -> str: ...
def _value_or_setting(
self,
value: Optional[Union[str, int]],
setting: Optional[Union[str, int]]
) -> Optional[Union[str, int]]: ...
@cached_property
def base_location(self) -> str: ...
@cached_property
def base_url(self) -> str: ...
def delete(self, name: str) -> None: ...
@cached_property
def directory_permissions_mode(self) -> Optional[int]: ...
def exists(self, name: str) -> bool: ...
@cached_property
def file_permissions_mode(self) -> Optional[int]: ...
def get_accessed_time(self, name: str) -> datetime: ...
def get_created_time(self, name: str) -> datetime: ...
def get_modified_time(self, name: str) -> datetime: ...
def listdir(
self,
path: str
) -> Union[Tuple[List[Any], List[Any]], Tuple[List[Any], List[str]], Tuple[List[str], List[Any]], Tuple[List[str], List[str]]]: ...
@cached_property
def location(self) -> str: ...
def path(self, name: str) -> str: ...
def size(self, name: str) -> int: ...
def url(self, name: str) -> str: ...
class Storage:
def generate_filename(self, filename: str) -> str: ...
def get_available_name(self, name: str, max_length: Optional[int] = ...) -> str: ...
def get_valid_name(self, name: str) -> str: ...
def open(self, name: str, mode: str = ...) -> File: ...
def save(
self,
name: Optional[str],
content: Union[StringIO, File],
max_length: Optional[int] = ...
) -> str: ...
+57
View File
@@ -0,0 +1,57 @@
from io import (
BytesIO,
StringIO,
)
from tempfile import _TemporaryFileWrapper
from typing import (
Iterator,
Optional,
Union,
)
class InMemoryUploadedFile:
def __init__(
self,
file: Union[StringIO, BytesIO],
field_name: Optional[str],
name: str,
content_type: str,
size: int,
charset: Optional[str],
content_type_extra: None = ...
) -> None: ...
def chunks(self, chunk_size: None = ...) -> Iterator[Union[str, bytes]]: ...
def open(self, mode: None = ...) -> InMemoryUploadedFile: ...
class SimpleUploadedFile:
def __init__(self, name: str, content: Optional[bytes], content_type: str = ...) -> None: ...
class TemporaryUploadedFile:
def __init__(
self,
name: str,
content_type: str,
size: int,
charset: str,
content_type_extra: None = ...
) -> None: ...
def close(self) -> None: ...
def temporary_file_path(self) -> str: ...
class UploadedFile:
def __init__(
self,
file: Optional[Union[_TemporaryFileWrapper, StringIO, BytesIO]] = ...,
name: str = ...,
content_type: str = ...,
size: Optional[int] = ...,
charset: Optional[str] = ...,
content_type_extra: None = ...
) -> None: ...
def __repr__(self) -> str: ...
def _get_name(self) -> str: ...
def _set_name(self, name: str) -> None: ...
+57
View File
@@ -0,0 +1,57 @@
from io import BytesIO
from django.core.files.uploadedfile import (
InMemoryUploadedFile,
TemporaryUploadedFile,
)
from django.core.handlers.wsgi import WSGIRequest
from typing import (
Any,
Dict,
Optional,
Union,
)
def load_handler(path: str, *args, **kwargs) -> FileUploadHandler: ...
class FileUploadHandler:
def __init__(self, request: WSGIRequest = ...) -> None: ...
def handle_raw_input(
self,
input_data: WSGIRequest,
META: Dict[str, Any],
content_length: int,
boundary: bytes,
encoding: str = ...
) -> None: ...
def new_file(
self,
field_name: str,
file_name: str,
content_type: str,
content_length: None,
charset: None = ...,
content_type_extra: Dict[Any, Any] = ...
) -> None: ...
def upload_complete(self) -> None: ...
class MemoryFileUploadHandler:
def file_complete(self, file_size: int) -> Optional[InMemoryUploadedFile]: ...
def handle_raw_input(
self,
input_data: Union[BytesIO, WSGIRequest],
META: Dict[str, Any],
content_length: int,
boundary: bytes,
encoding: str = ...
) -> None: ...
def new_file(self, *args, **kwargs) -> None: ...
def receive_data_chunk(self, raw_data: bytes, start: int) -> Optional[bytes]: ...
class TemporaryFileUploadHandler:
def file_complete(self, file_size: int) -> TemporaryUploadedFile: ...
def new_file(self, *args, **kwargs) -> None: ...
def receive_data_chunk(self, raw_data: bytes, start: int) -> None: ...
+4
View File
@@ -0,0 +1,4 @@
class FileProxyMixin:
@property
def closed(self) -> bool: ...
def readable(self) -> bool: ...
+25
View File
@@ -0,0 +1,25 @@
from django.core.handlers.wsgi import WSGIRequest
from django.http.response import (
FileResponse,
HttpResponse,
HttpResponseBase,
)
from typing import (
Callable,
Union,
)
class BaseHandler:
def _get_response(
self,
request: WSGIRequest
) -> Union[HttpResponse, FileResponse]: ...
def get_response(self, request: WSGIRequest) -> HttpResponseBase: ...
def load_middleware(self) -> None: ...
def make_view_atomic(self, view: Callable) -> Callable: ...
def process_exception_by_middleware(
self,
exception: Exception,
request: WSGIRequest
) -> HttpResponse: ...
+22
View File
@@ -0,0 +1,22 @@
from django.core.handlers.wsgi import WSGIRequest
from django.http.response import HttpResponse
from django.urls.resolvers import URLResolver
from typing import Callable
def convert_exception_to_response(get_response: Callable) -> Callable: ...
def get_exception_response(
request: WSGIRequest,
resolver: URLResolver,
status_code: int,
exception: Exception,
sender: None = ...
) -> HttpResponse: ...
def response_for_exception(
request: WSGIRequest,
exc: Exception
) -> HttpResponse: ...
+54
View File
@@ -0,0 +1,54 @@
from io import BytesIO
from django.http.request import QueryDict
from django.http.response import HttpResponse
from django.test.client import FakePayload
from django.utils.datastructures import MultiValueDict
from typing import (
Any,
Callable,
Dict,
Optional,
Union,
)
def get_bytes_from_wsgi(environ: Dict[str, Any], key: str, default: str) -> bytes: ...
def get_path_info(environ: Dict[str, Any]) -> str: ...
def get_script_name(environ: Dict[str, Any]) -> str: ...
def get_str_from_wsgi(environ: Dict[str, Any], key: str, default: str) -> str: ...
class LimitedStream:
def __init__(
self,
stream: Union[str, BytesIO, FakePayload],
limit: int,
buf_size: int = ...
) -> None: ...
def _read_limited(self, size: Optional[int] = ...) -> bytes: ...
def read(self, size: Optional[int] = ...) -> bytes: ...
def readline(self, size: Optional[int] = ...) -> bytes: ...
class WSGIHandler:
def __call__(self, environ: Dict[str, Any], start_response: Callable) -> HttpResponse: ...
def __init__(self, *args, **kwargs) -> None: ...
class WSGIRequest:
@cached_property
def COOKIES(self) -> Dict[str, str]: ...
@property
def FILES(self) -> MultiValueDict: ...
@cached_property
def GET(self) -> QueryDict: ...
def __init__(self, environ: Dict[str, Any]) -> None: ...
def _get_post(self) -> QueryDict: ...
def _get_scheme(self) -> str: ...
def _set_post(self, post: QueryDict) -> None: ...
+54
View File
@@ -0,0 +1,54 @@
from django.core.mail.backends.base import BaseEmailBackend
from mail.custombackend import EmailBackend
from typing import (
List,
Optional,
Tuple,
)
def get_connection(
backend: Optional[str] = ...,
fail_silently: bool = ...,
**kwds
) -> BaseEmailBackend: ...
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: None = ...,
html_message: None = ...
) -> None: ...
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: EmailBackend = ...
) -> int: ...
+6
View File
@@ -0,0 +1,6 @@
class BaseEmailBackend:
def __enter__(self) -> BaseEmailBackend: ...
def __exit__(self, exc_type: None, exc_value: None, traceback: None) -> None: ...
def __init__(self, fail_silently: bool = ..., **kwargs) -> None: ...
def close(self) -> None: ...
def open(self) -> None: ...
+17
View File
@@ -0,0 +1,17 @@
from django.core.mail.message import (
EmailMessage,
EmailMultiAlternatives,
)
from typing import (
List,
Union,
)
class EmailBackend:
def __init__(self, *args, **kwargs) -> None: ...
def send_messages(
self,
email_messages: Union[List[EmailMultiAlternatives], List[EmailMessage]]
) -> int: ...
def write_message(self, message: EmailMultiAlternatives) -> None: ...
+6
View File
@@ -0,0 +1,6 @@
from django.core.mail.message import EmailMessage
from typing import List
class EmailBackend:
def send_messages(self, email_messages: List[EmailMessage]) -> int: ...
+9
View File
@@ -0,0 +1,9 @@
from django.core.mail.message import EmailMessage
class EmailBackend:
def __init__(self, *args, file_path = ..., **kwargs) -> None: ...
def _get_filename(self) -> str: ...
def close(self) -> None: ...
def open(self) -> bool: ...
def write_message(self, message: EmailMessage) -> None: ...
+16
View File
@@ -0,0 +1,16 @@
from django.core.mail.message import (
EmailMessage,
EmailMultiAlternatives,
)
from typing import (
List,
Union,
)
class EmailBackend:
def __init__(self, *args, **kwargs) -> None: ...
def send_messages(
self,
messages: Union[List[EmailMultiAlternatives], List[EmailMessage]]
) -> int: ...
+30
View File
@@ -0,0 +1,30 @@
from django.core.mail.message import EmailMessage
from smtplib import SMTP
from typing import (
List,
Optional,
Type,
)
class EmailBackend:
def __init__(
self,
host: None = ...,
port: None = ...,
username: Optional[str] = ...,
password: Optional[str] = ...,
use_tls: None = ...,
fail_silently: bool = ...,
use_ssl: None = ...,
timeout: None = ...,
ssl_keyfile: None = ...,
ssl_certfile: None = ...,
**kwargs
) -> None: ...
def _send(self, email_message: EmailMessage) -> bool: ...
def close(self) -> None: ...
@property
def connection_class(self) -> Type[SMTP]: ...
def open(self) -> bool: ...
def send_messages(self, email_messages: List[EmailMessage]) -> int: ...
+116
View File
@@ -0,0 +1,116 @@
from django.core.mail.backends.base import BaseEmailBackend
from email.mime.base import MIMEBase
from email.mime.text import MIMEText
from typing import (
Any,
Dict,
List,
Optional,
Tuple,
Union,
)
def forbid_multi_line_headers(name: str, val: str, encoding: str) -> Tuple[str, str]: ...
def sanitize_address(addr: Union[str, Tuple[str, str]], encoding: str) -> str: ...
def split_addr(addr: str, encoding: str) -> Tuple[str, str]: ...
class EmailMessage:
def __init__(
self,
subject: str = ...,
body: str = ...,
from_email: Optional[str] = ...,
to: Optional[List[str]] = ...,
bcc: None = ...,
connection: Any = ...,
attachments: Optional[List[MIMEText]] = ...,
headers: Optional[Dict[str, str]] = ...,
cc: Optional[List[str]] = ...,
reply_to: Optional[List[str]] = ...
) -> None: ...
def _create_attachment(
self,
filename: Optional[str],
content: Union[str, bytes, SafeMIMEText],
mimetype: str = ...
) -> MIMEBase: ...
def _create_attachments(
self,
msg: Union[SafeMIMEMultipart, SafeMIMEText]
) -> Union[SafeMIMEMultipart, SafeMIMEText]: ...
def _create_message(
self,
msg: SafeMIMEText
) -> Union[SafeMIMEMultipart, SafeMIMEText]: ...
def _create_mime_attachment(self, content: Union[str, bytes], mimetype: str) -> MIMEBase: ...
def _set_list_header_if_not_empty(
self,
msg: Union[SafeMIMEMultipart, SafeMIMEText],
header: str,
values: List[str]
) -> None: ...
def attach(self, filename: str = ..., content: bytes = ..., mimetype: Optional[str] = ...) -> None: ...
def attach_file(self, path: str, mimetype: Optional[str] = ...) -> None: ...
def get_connection(self, fail_silently: bool = ...) -> BaseEmailBackend: ...
def message(self) -> Union[SafeMIMEMultipart, SafeMIMEText]: ...
def recipients(self) -> List[str]: ...
def send(self, fail_silently: bool = ...) -> int: ...
class EmailMultiAlternatives:
def __init__(
self,
subject: str = ...,
body: str = ...,
from_email: Optional[str] = ...,
to: List[str] = ...,
bcc: None = ...,
connection: Any = ...,
attachments: None = ...,
headers: Optional[Dict[str, str]] = ...,
alternatives: None = ...,
cc: None = ...,
reply_to: None = ...
) -> None: ...
def _create_alternatives(
self,
msg: SafeMIMEText
) -> Union[SafeMIMEMultipart, SafeMIMEText]: ...
def _create_message(
self,
msg: SafeMIMEText
) -> Union[SafeMIMEMultipart, SafeMIMEText]: ...
def attach_alternative(self, content: str, mimetype: str) -> None: ...
class MIMEMixin:
def as_bytes(self, unixfrom: bool = ..., linesep: str = ...) -> bytes: ...
def as_string(self, unixfrom: bool = ..., linesep: str = ...) -> str: ...
class SafeMIMEMessage:
def __setitem__(self, name: str, val: str) -> None: ...
class SafeMIMEMultipart:
def __init__(
self,
_subtype: str = ...,
boundary: None = ...,
_subparts: None = ...,
encoding: str = ...,
**_params
) -> None: ...
def __setitem__(self, name: str, val: str) -> None: ...
class SafeMIMEText:
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: ...
+3
View File
@@ -0,0 +1,3 @@
class CachedDnsName:
def __str__(self) -> str: ...
def get_fqdn(self) -> str: ...
+26
View File
@@ -0,0 +1,26 @@
from django.core.management.base import BaseCommand
from typing import (
Dict,
List,
Optional,
Union,
)
def call_command(command_name: Union[str, BaseCommand], *args, **options) -> Optional[str]: ...
def find_commands(management_dir: str) -> List[str]: ...
def get_commands() -> Dict[str, str]: ...
def load_command_class(app_name: str, name: str) -> BaseCommand: ...
class ManagementUtility:
def __init__(self, argv: List[str] = ...) -> None: ...
def autocomplete(self): ...
def execute(self) -> None: ...
def fetch_command(self, subcommand: str) -> BaseCommand: ...
+76
View File
@@ -0,0 +1,76 @@
from io import (
StringIO,
TextIOWrapper,
)
from argparse import (
Action,
Namespace,
)
from django.core.checks.messages import Warning
from typing import (
Any,
Callable,
List,
Optional,
Tuple,
Union,
)
def handle_default_options(options: Namespace) -> None: ...
def no_translations(handle_func: Callable) -> Callable: ...
class BaseCommand:
def __init__(
self,
stdout: Optional[StringIO] = ...,
stderr: None = ...,
no_color: bool = ...
) -> None: ...
def _run_checks(self, **kwargs) -> List[Warning]: ...
def add_arguments(self, parser: CommandParser) -> None: ...
def check(
self,
app_configs: None = ...,
tags: None = ...,
display_num_errors: bool = ...,
include_deployment_checks: bool = ...,
fail_level: int = ...
) -> None: ...
def check_migrations(self) -> None: ...
def create_parser(self, prog_name: str, subcommand: str) -> CommandParser: ...
def execute(self, *args, **options) -> Optional[Union[str, Tuple]]: ...
def get_version(self) -> str: ...
def print_help(self, prog_name: str, subcommand: str) -> None: ...
def run_from_argv(self, argv: List[str]): ...
class CommandParser:
def __init__(self, **kwargs) -> None: ...
def error(self, message: str): ...
def parse_args(self, args: List[str] = ..., namespace: None = ...) -> Namespace: ...
class DjangoHelpFormatter:
def _reordered_actions(self, actions: List[Action]) -> List[Action]: ...
def add_usage(self, usage: None, actions: List[Any], *args, **kwargs) -> None: ...
class LabelCommand:
def add_arguments(self, parser: CommandParser) -> None: ...
def handle(self, *labels, **options) -> str: ...
class OutputWrapper:
def __getattr__(self, name: str) -> Callable: ...
def __init__(
self,
out: Union[StringIO, TextIOWrapper],
style_func: Optional[Callable] = ...,
ending: str = ...
) -> None: ...
def isatty(self) -> bool: ...
def write(self, msg: str, style_func: Optional[Callable] = ..., ending: Optional[str] = ...) -> None: ...
+7
View File
@@ -0,0 +1,7 @@
def color_style() -> Style: ...
def make_style(config_string: str = ...) -> Style: ...
def supports_color() -> bool: ...
@@ -0,0 +1,6 @@
from django.core.management.base import CommandParser
class Command:
def add_arguments(self, parser: CommandParser) -> None: ...
def handle(self, *app_labels, **options) -> None: ...
@@ -0,0 +1,17 @@
from django.core.management.base import CommandParser
from typing import (
List,
Tuple,
)
def has_bom(fn: str) -> bool: ...
def is_writable(path: str) -> bool: ...
class Command:
def add_arguments(self, parser: CommandParser) -> None: ...
def compile_messages(self, locations: List[Tuple[str, str]]) -> None: ...
def handle(self, **options) -> None: ...
@@ -0,0 +1,7 @@
from django.core.management.base import CommandParser
class Command:
def add_arguments(self, parser: CommandParser) -> None: ...
def create_table(self, database: str, tablename: str, dry_run: bool) -> None: ...
def handle(self, *tablenames, **options) -> None: ...
@@ -0,0 +1,6 @@
from django.core.management.base import CommandParser
class Command:
def add_arguments(self, parser: CommandParser) -> None: ...
def handle(self, *app_labels, **options) -> None: ...
@@ -0,0 +1,6 @@
from django.core.management.base import CommandParser
class Command:
def add_arguments(self, parser: CommandParser) -> None: ...
def handle(self, **options) -> None: ...
@@ -0,0 +1,37 @@
from collections import OrderedDict
from django.core.management.base import CommandParser
from django.db.backends.base.introspection import FieldInfo
from django.db.backends.sqlite3.base import DatabaseWrapper
from typing import (
Any,
Dict,
Iterator,
List,
Tuple,
Union,
)
class Command:
def add_arguments(self, parser: CommandParser) -> None: ...
def get_field_type(
self,
connection: DatabaseWrapper,
table_name: str,
row: FieldInfo
) -> Union[Tuple[str, OrderedDict, List[str]], Tuple[str, OrderedDict, List[Any]]]: ...
def get_meta(
self,
table_name: str,
constraints: Dict[str, Dict[str, Union[List[str], bool, str, Tuple[str, str]]]],
column_to_field_name: Dict[str, str],
is_view: bool
) -> List[str]: ...
def handle(self, **options) -> 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
) -> Union[Tuple[str, Dict[str, str], List[str]], Tuple[str, Dict[Any, Any], List[Any]]]: ...
@@ -0,0 +1,27 @@
from django.core.management.base import CommandParser
from typing import (
List,
Tuple,
Union,
)
def humanize(dirname: str) -> str: ...
class Command:
def add_arguments(self, parser: CommandParser) -> None: ...
def find_fixtures(self, fixture_label: str) -> List[Tuple[str, str, str]]: ...
@cached_property
def fixture_dirs(self) -> List[str]: ...
def handle(self, *fixture_labels, **options) -> None: ...
def load_label(self, fixture_label: str) -> None: ...
def loaddata(self, fixture_labels: Union[Tuple[str], Tuple[str, str]]) -> None: ...
def parse_name(
self,
fixture_name: str
) -> Union[Tuple[str, str, str], Tuple[str, str, None], Tuple[str, None, None]]: ...
class SingleZipReader:
def read(self) -> bytes: ...
@@ -0,0 +1,60 @@
from django.core.management.base import CommandParser
from typing import (
List,
Tuple,
)
def check_programs(*programs) -> None: ...
def normalize_eols(raw_contents: str) -> str: ...
def write_pot_file(potfile: str, msgs: str) -> None: ...
class BuildFile:
def __init__(
self,
command: Command,
domain: str,
translatable: TranslatableFile
) -> None: ...
def cleanup(self) -> None: ...
@cached_property
def is_templatized(self) -> bool: ...
@cached_property
def path(self) -> str: ...
def postprocess_messages(self, msgs: str) -> str: ...
def preprocess(self) -> None: ...
@cached_property
def work_path(self) -> str: ...
class Command:
def add_arguments(self, parser: CommandParser) -> None: ...
def build_potfiles(self) -> List[str]: ...
def copy_plural_forms(self, msgs: str, locale: str) -> str: ...
def find_files(self, root: str) -> List[TranslatableFile]: ...
@cached_property
def gettext_version(self) -> Tuple[int, int, int]: ...
def handle(self, *args, **options) -> None: ...
def process_files(self, file_list: List[TranslatableFile]) -> None: ...
def process_locale_dir(
self,
locale_dir: str,
files: List[TranslatableFile]
) -> None: ...
def remove_potfiles(self) -> None: ...
@cached_property
def settings_available(self) -> bool: ...
def write_po_file(self, potfile: str, locale: str) -> None: ...
class TranslatableFile:
def __eq__(self, other: TranslatableFile) -> bool: ...
def __init__(self, dirpath: str, file_name: str, locale_dir: object) -> None: ...
def __lt__(self, other: TranslatableFile) -> bool: ...
@property
def path(self) -> str: ...
@@ -0,0 +1,14 @@
from django.core.management.base import CommandParser
from django.db.migrations.loader import MigrationLoader
from django.db.migrations.migration import Migration
from typing import (
Dict,
List,
Set,
)
class Command:
def add_arguments(self, parser: CommandParser) -> None: ...
def handle_merge(self, loader: MigrationLoader, conflicts: Dict[str, Set[str]]) -> None: ...
def write_migration_files(self, changes: Dict[str, List[Migration]]) -> None: ...
@@ -0,0 +1,14 @@
from django.core.management.base import CommandParser
from django.db.backends.sqlite3.base import DatabaseWrapper
from typing import (
Any,
List,
Set,
)
class Command:
def _run_checks(self, **kwargs) -> List[Any]: ...
def add_arguments(self, parser: CommandParser) -> None: ...
def migration_progress_callback(self, action: str, migration: Any = ..., fake: bool = ...) -> None: ...
def sync_apps(self, connection: DatabaseWrapper, app_labels: Set[str]) -> None: ...
@@ -0,0 +1,9 @@
from django.core.handlers.wsgi import WSGIHandler
from django.core.management.base import CommandParser
class Command:
def add_arguments(self, parser: CommandParser) -> None: ...
def execute(self, *args, **options) -> None: ...
def get_handler(self, *args, **options) -> WSGIHandler: ...
def handle(self, *args, **options) -> None: ...
@@ -0,0 +1,6 @@
from django.core.management.base import CommandParser
class Command:
def add_arguments(self, parser: CommandParser) -> None: ...
def handle(self, *args, **kwargs) -> None: ...
@@ -0,0 +1,5 @@
from django.core.management.base import CommandParser
class Command:
def add_arguments(self, parser: CommandParser) -> None: ...
@@ -0,0 +1,20 @@
from django.core.management.base import CommandParser
from django.db.backends.sqlite3.base import DatabaseWrapper
from django.db.migrations.loader import MigrationLoader
from typing import List
class Command:
def _validate_app_names(self, loader: MigrationLoader, app_names: List[str]) -> None: ...
def add_arguments(self, parser: CommandParser) -> None: ...
def handle(self, *args, **options) -> None: ...
def show_list(
self,
connection: DatabaseWrapper,
app_names: List[str] = ...
) -> None: ...
def show_plan(
self,
connection: DatabaseWrapper,
app_names: List[str] = ...
) -> None: ...
@@ -0,0 +1,6 @@
from django.core.management.base import CommandParser
class Command:
def add_arguments(self, parser: CommandParser) -> None: ...
def execute(self, *args, **options) -> str: ...
@@ -0,0 +1,6 @@
from django.core.management.base import CommandParser
class Command:
def add_arguments(self, parser: CommandParser) -> None: ...
def handle(self, **options) -> None: ...
+2
View File
@@ -0,0 +1,2 @@
class Command:
def handle(self, *test_labels, **options): ...
@@ -0,0 +1,2 @@
class Command:
def handle(self, *fixture_labels, **options) -> None: ...
+18
View File
@@ -0,0 +1,18 @@
from django.core.management.color import Style
from django.db.backends.sqlite3.base import DatabaseWrapper
from typing import List
def emit_post_migrate_signal(verbosity: int, interactive: bool, db: str, **kwargs) -> None: ...
def emit_pre_migrate_signal(verbosity: int, interactive: bool, db: str, **kwargs) -> None: ...
def sql_flush(
style: Style,
connection: DatabaseWrapper,
only_django: bool = ...,
reset_sequences: bool = ...,
allow_cascade: bool = ...
) -> List[str]: ...
+5
View File
@@ -0,0 +1,5 @@
from django.core.management.base import CommandParser
class TemplateCommand:
def add_arguments(self, parser: CommandParser) -> None: ...
+23
View File
@@ -0,0 +1,23 @@
from django.db.models.base import Model
from typing import (
Any,
List,
Set,
Tuple,
Type,
Union,
)
def find_command(cmd: str, path: None = ..., pathext: None = ...) -> str: ...
def handle_extensions(extensions: List[str]) -> Set[str]: ...
def parse_apps_and_model_labels(
labels: List[str]
) -> Union[Tuple[Set[Type[Model]], Set[Any]], Tuple[Set[Any], Set[Any]]]: ...
def popen_wrapper(args: List[str], stdout_encoding: str = ...) -> Tuple[str, str, int]: ...
+46
View File
@@ -0,0 +1,46 @@
from django.db.models.base import Model
from django.db.models.query import QuerySet
from typing import (
List,
Optional,
Union,
)
class Page:
def __getitem__(self, index: Union[slice, int]) -> Union[str, List[Model]]: ...
def __init__(
self,
object_list: Union[QuerySet, str, List[object], List[int]],
number: int,
paginator: Paginator
) -> None: ...
def __repr__(self) -> str: ...
def end_index(self) -> int: ...
def has_next(self) -> bool: ...
def has_other_pages(self) -> bool: ...
def has_previous(self) -> bool: ...
def next_page_number(self) -> int: ...
def previous_page_number(self) -> int: ...
def start_index(self) -> int: ...
class Paginator:
def __init__(
self,
object_list: Union[List[object], QuerySet, List[int]],
per_page: Union[str, int],
orphans: Union[str, int] = ...,
allow_empty_first_page: bool = ...
) -> None: ...
def _check_object_list_is_ordered(self) -> None: ...
def _get_page(self, *args, **kwargs) -> Page: ...
@cached_property
def count(self) -> int: ...
def get_page(self, number: Optional[int]) -> Page: ...
@cached_property
def num_pages(self) -> int: ...
def page(self, number: Union[str, int]) -> Page: ...
@property
def page_range(self) -> range: ...
def validate_number(self, number: Optional[Union[str, float, int]]) -> int: ...
+59
View File
@@ -0,0 +1,59 @@
from collections import OrderedDict
from django.apps.config import AppConfig
from django.contrib.admin.apps import SimpleAdminConfig
from django.contrib.sites.apps import SitesConfig
from django.core.serializers.json import Serializer
from django.core.serializers.python import Serializer
from django.core.serializers.xml_serializer import (
Deserializer,
Serializer,
)
from django.db.models.base import Model
from django.db.models.query import QuerySet
from typing import (
Any,
Callable,
Dict,
List,
Optional,
Tuple,
Type,
Union,
)
def _load_serializers() -> None: ...
def deserialize(format: str, stream_or_string: Any, **options) -> Deserializer: ...
def get_deserializer(format: str) -> Union[Type[Deserializer], Callable]: ...
def get_public_serializer_formats() -> List[str]: ...
def get_serializer(
format: str
) -> Union[Type[Serializer], Type[Serializer], Type[Serializer], BadSerializer]: ...
def register_serializer(format: str, serializer_module: str, serializers: Dict[str, Any] = ...) -> None: ...
def serialize(
format: str,
queryset: Union[List[Model], QuerySet],
**options
) -> Optional[Union[str, List[OrderedDict]]]: ...
def sort_dependencies(
app_list: Union[List[Union[Tuple[SitesConfig, None], Tuple[SimpleAdminConfig, None], Tuple[AppConfig, None]]], List[Tuple[str, List[Type[Model]]]], List[Union[Tuple[SitesConfig, None], Tuple[SimpleAdminConfig, None]]]]
) -> List[Type[Model]]: ...
class BadSerializer:
def __call__(self, *args, **kwargs): ...
def __init__(self, exception: ModuleNotFoundError) -> None: ...
+86
View File
@@ -0,0 +1,86 @@
from io import (
BufferedReader,
StringIO,
TextIOWrapper,
)
from collections import OrderedDict
from django.core.exceptions import ValidationError
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
from typing import (
Any,
Dict,
List,
Optional,
Union,
)
from uuid import UUID
def build_instance(Model: Any, data: Dict[str, Any], db: str) -> Model: ...
def deserialize_fk_value(
field: ForeignKey,
field_value: Any,
using: str
) -> Optional[Union[str, UUID, int]]: ...
def deserialize_m2m_values(
field: ManyToManyField,
field_value: Union[List[List[str]], List[Union[int, str]], List[int]],
using: str
) -> List[int]: ...
class DeserializationError:
@classmethod
def WithData(
cls,
original_exc: ValidationError,
model: str,
fk: str,
field_value: None
) -> DeserializationError: ...
class DeserializedObject:
def __init__(self, obj: Model, m2m_data: Dict[str, List[int]] = ...) -> None: ...
def __repr__(self) -> str: ...
def save(self, save_m2m: bool = ..., using: Optional[str] = ..., **kwargs) -> None: ...
class Deserializer:
def __init__(self, stream_or_string: Union[str, BufferedReader, TextIOWrapper], **options) -> None: ...
def __iter__(self) -> Deserializer: ...
class M2MDeserializationError:
def __init__(self, original_exc: ValidationError, pk: str) -> None: ...
class ProgressBar:
def __init__(self, output: Optional[StringIO], total_count: int) -> None: ...
def update(self, count: int) -> None: ...
class Serializer:
def getvalue(self) -> Optional[str]: ...
def serialize(
self,
queryset: Union[List[Model], QuerySet],
*,
stream = ...,
fields = ...,
use_natural_foreign_keys = ...,
use_natural_primary_keys = ...,
progress_output = ...,
object_count = ...,
**options
) -> Optional[Union[str, List[OrderedDict]]]: ...
+27
View File
@@ -0,0 +1,27 @@
from datetime import (
date,
timedelta,
)
from decimal import Decimal
from django.db.models.base import Model
from typing import (
Any,
Optional,
Union,
)
from uuid import UUID
def Deserializer(stream_or_string: Any, **options) -> None: ...
class DjangoJSONEncoder:
def default(self, o: Union[Decimal, UUID, date, timedelta]) -> str: ...
class Serializer:
def _init_options(self) -> None: ...
def end_object(self, obj: Model) -> None: ...
def end_serialization(self) -> None: ...
def getvalue(self) -> Optional[str]: ...
def start_serialization(self) -> None: ...
+46
View File
@@ -0,0 +1,46 @@
from collections import OrderedDict
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,
)
from typing import (
Any,
Iterator,
List,
)
def Deserializer(
object_list: Any,
*,
using = ...,
ignorenonexistent = ...,
**options
) -> Iterator[DeserializedObject]: ...
def _get_model(model_identifier: str) -> Any: ...
class Serializer:
def _value_from_field(self, obj: Model, field: Field) -> Any: ...
def end_object(self, obj: Model) -> None: ...
def end_serialization(self) -> None: ...
def get_dump_object(self, obj: Model) -> OrderedDict: ...
def getvalue(self) -> List[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 start_object(self, obj: Model) -> None: ...
def start_serialization(self) -> None: ...
@@ -0,0 +1,74 @@
from io import (
BufferedReader,
TextIOWrapper,
)
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,
)
from typing import (
Any,
List,
Optional,
Union,
)
from xml.dom.minidom import Element
def getInnerText(node: Element) -> str: ...
class DefusedExpatParser:
def __init__(self, *args, **kwargs) -> None: ...
def reset(self) -> None: ...
class Deserializer:
def __init__(
self,
stream_or_string: Union[str, TextIOWrapper, BufferedReader],
*,
using = ...,
ignorenonexistent = ...,
**options
) -> None: ...
def __next__(self) -> DeserializedObject: ...
def _get_model_from_node(self, node: Element, attr: str) -> Any: ...
def _handle_fk_field_node(
self,
node: Element,
field: ForeignKey
) -> Optional[int]: ...
def _handle_m2m_field_node(
self,
node: Element,
field: ManyToManyField
) -> List[int]: ...
def _handle_object(self, node: Element) -> DeserializedObject: ...
def _make_parser(self) -> DefusedExpatParser: ...
class Serializer:
def _start_relational_field(
self,
field: Union[ManyToManyField, ForeignKey]
) -> None: ...
def end_object(self, obj: Model) -> None: ...
def end_serialization(self) -> 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: ...
def indent(self, level: int) -> None: ...
def start_object(self, obj: Model) -> None: ...
def start_serialization(self) -> None: ...
+10
View File
@@ -0,0 +1,10 @@
from typing import Dict
def get_internal_wsgi_application() -> object: ...
class WSGIRequestHandler:
def address_string(self) -> str: ...
def get_environ(self) -> Dict[str, str]: ...
def log_message(self, format: str, *args) -> None: ...
+63
View File
@@ -0,0 +1,63 @@
from datetime import datetime
from django.contrib.sessions.serializers import PickleSerializer
from typing import (
Any,
Dict,
List,
Optional,
Type,
Union,
)
def b64_decode(s: bytes) -> bytes: ...
def b64_encode(s: bytes) -> bytes: ...
def base64_hmac(salt: str, value: Union[str, bytes], key: Union[str, bytes]) -> str: ...
def dumps(
obj: Union[str, Dict[str, str], Dict[str, Union[str, datetime]], List[str]],
key: None = ...,
salt: str = ...,
serializer: Type[Union[JSONSerializer, PickleSerializer]] = ...,
compress: bool = ...
) -> str: ...
def get_cookie_signer(salt: str = ...) -> TimestampSigner: ...
def loads(
s: str,
key: None = ...,
salt: str = ...,
serializer: Type[Union[JSONSerializer, PickleSerializer]] = ...,
max_age: Optional[int] = ...
) -> Union[str, Dict[str, str], List[str]]: ...
class JSONSerializer:
def dumps(self, obj: Any) -> bytes: ...
def loads(self, data: bytes) -> Union[Dict[str, str], List[str]]: ...
class Signer:
def __init__(
self,
key: Optional[Union[str, bytes]] = ...,
sep: str = ...,
salt: Optional[str] = ...
) -> None: ...
def sign(self, value: str) -> str: ...
def signature(self, value: Union[str, bytes]) -> str: ...
def unsign(self, signed_value: str) -> str: ...
class TimestampSigner:
def sign(self, value: str) -> str: ...
def timestamp(self) -> str: ...
def unsign(self, value: str, max_age: Optional[int] = ...) -> str: ...
+125
View File
@@ -0,0 +1,125 @@
from datetime import datetime
from decimal import Decimal
from django.core.files.base import ContentFile
from django.utils.functional import SimpleLazyObject
from re import RegexFlag
from typing import (
Any,
List,
Optional,
Union,
)
def _lazy_re_compile(regex: str, flags: int = ...) -> SimpleLazyObject: ...
def int_list_validator(
sep: str = ...,
message: None = ...,
code: str = ...,
allow_negative: bool = ...
) -> RegexValidator: ...
def ip_address_validators(protocol: str, unpack_ipv4: bool): ...
def validate_integer(value: str) -> None: ...
def validate_ipv46_address(value: str) -> None: ...
def validate_ipv4_address(value: str) -> None: ...
def validate_ipv6_address(value: str) -> None: ...
class BaseValidator:
def __call__(self, value: Any) -> None: ...
def __init__(self, limit_value: Any, message: None = ...) -> None: ...
def clean(
self,
x: Union[float, datetime, int, Decimal]
) -> Union[float, datetime, int, Decimal]: ...
def compare(self, a: bool, b: bool) -> bool: ...
class DecimalValidator:
def __call__(self, value: Decimal) -> None: ...
def __eq__(self, other: DecimalValidator) -> bool: ...
def __init__(self, max_digits: Optional[int], decimal_places: Optional[int]) -> None: ...
class EmailValidator:
def __call__(self, value: str) -> None: ...
def __eq__(self, other: EmailValidator) -> bool: ...
def __init__(
self,
message: Optional[str] = ...,
code: Optional[str] = ...,
whitelist: Optional[List[str]] = ...
) -> None: ...
def validate_domain_part(self, domain_part: str) -> bool: ...
class FileExtensionValidator:
def __call__(self, value: ContentFile): ...
def __eq__(self, other: FileExtensionValidator) -> bool: ...
def __init__(
self,
allowed_extensions: Optional[List[str]] = ...,
message: Optional[str] = ...,
code: Optional[str] = ...
) -> None: ...
class MaxLengthValidator:
def clean(self, x: str) -> int: ...
def compare(self, a: int, b: int) -> bool: ...
class MaxValueValidator:
def compare(self, a: Union[float, Decimal, int], b: Union[float, Decimal, int]) -> bool: ...
class MinLengthValidator:
def clean(self, x: str) -> int: ...
def compare(self, a: int, b: int) -> bool: ...
class MinValueValidator:
def compare(
self,
a: Union[float, Decimal, int, datetime],
b: Union[float, Decimal, int, datetime]
) -> bool: ...
class ProhibitNullCharactersValidator:
def __call__(self, value: Optional[str]) -> None: ...
def __eq__(
self,
other: Union[RegexValidator, ProhibitNullCharactersValidator]
) -> bool: ...
def __init__(self, message: Optional[str] = ..., code: Optional[str] = ...) -> None: ...
class RegexValidator:
def __call__(self, value: Union[str, float]) -> None: ...
def __eq__(self, other: RegexValidator) -> bool: ...
def __init__(
self,
regex: Optional[str] = ...,
message: Optional[str] = ...,
code: Optional[str] = ...,
inverse_match: Optional[bool] = ...,
flags: Optional[RegexFlag] = ...
) -> None: ...
class URLValidator:
def __call__(self, value: str) -> None: ...
def __init__(self, schemes: Optional[List[str]] = ..., **kwargs) -> None: ...
+4
View File
@@ -0,0 +1,4 @@
from django.core.handlers.wsgi import WSGIHandler
def get_wsgi_application() -> WSGIHandler: ...