mirror of
https://github.com/davidhalter/django-stubs.git
synced 2025-12-22 03:41:28 +08:00
better stubs
This commit is contained in:
@@ -1,73 +1,113 @@
|
||||
from django.core.handlers.wsgi import WSGIRequest
|
||||
from django.utils.datastructures import MultiValueDict
|
||||
from io import BytesIO
|
||||
from typing import Any, Dict, Iterator, List, Optional, Tuple, Union
|
||||
|
||||
def bytes_to_text(
|
||||
s: Optional[Union[str, bytes, int]], encoding: str
|
||||
) -> Optional[Union[str, int]]: ...
|
||||
def split_domain_port(host: str) -> Tuple[str, str]: ...
|
||||
def validate_host(host: str, allowed_hosts: Union[str, List[str]]) -> bool: ...
|
||||
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: django.contrib.sessions.backends.db.SessionStore
|
||||
GET: Union[Dict[str, str], django.http.request.QueryDict] = ...
|
||||
POST: Union[Dict[str, str], django.http.request.QueryDict] = ...
|
||||
COOKIES: Dict[str, str] = ...
|
||||
META: Dict[str, Union[str, int]] = ...
|
||||
FILES: django.utils.datastructures.MultiValueDict = ...
|
||||
path: str = ...
|
||||
path_info: str = ...
|
||||
method: Optional[str] = ...
|
||||
resolver_match: None = ...
|
||||
content_type: None = ...
|
||||
content_params: None = ...
|
||||
def __init__(self) -> None: ...
|
||||
def __iter__(self) -> Iterator[bytes]: ...
|
||||
def __repr__(self) -> str: ...
|
||||
@cached_property
|
||||
def _current_scheme_host(self) -> str: ...
|
||||
def _get_full_path(self, path: str, force_append_slash: bool) -> str: ...
|
||||
def _get_raw_host(self) -> str: ...
|
||||
def _get_scheme(self) -> str: ...
|
||||
def _initialize_handlers(self) -> None: ...
|
||||
def _load_post_and_files(self) -> None: ...
|
||||
def _mark_post_parse_error(self) -> None: ...
|
||||
@property
|
||||
def body(self) -> bytes: ...
|
||||
def build_absolute_uri(self, location: Optional[str] = ...) -> str: ...
|
||||
def close(self) -> None: ...
|
||||
def get_full_path(self, force_append_slash: bool = ...) -> str: ...
|
||||
def get_full_path_info(self, force_append_slash: bool = ...) -> str: ...
|
||||
def get_host(self) -> str: ...
|
||||
def get_port(self) -> str: ...
|
||||
def get_raw_uri(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: None = ..., salt: str = ..., max_age: None = ...
|
||||
) -> None: ...
|
||||
def is_ajax(self) -> bool: ...
|
||||
def is_secure(self) -> bool: ...
|
||||
def parse_file_upload(
|
||||
self, META: Dict[str, Any], post_data: WSGIRequest
|
||||
) -> Tuple[QueryDict, MultiValueDict]: ...
|
||||
def read(self, *args, **kwargs) -> bytes: ...
|
||||
def readline(self, *args, **kwargs) -> bytes: ...
|
||||
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[WSGIRequest, BytesIO]
|
||||
) -> 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:
|
||||
def __copy__(self) -> QueryDict: ...
|
||||
def __deepcopy__(self, memo: Dict[Any, Any]) -> QueryDict: ...
|
||||
def __delitem__(self, key: str): ...
|
||||
class QueryDict(MultiValueDict):
|
||||
encoding: Any = ...
|
||||
def __init__(
|
||||
self,
|
||||
query_string: Optional[Union[str, bytes]] = ...,
|
||||
mutable: bool = ...,
|
||||
encoding: Optional[str] = ...,
|
||||
) -> None: ...
|
||||
def __setitem__(self, key: str, value: Optional[Union[str, int]]) -> None: ...
|
||||
def _assert_mutable(self) -> None: ...
|
||||
def appendlist(self, key: str, value: Union[str, List[str]]) -> None: ...
|
||||
def clear(self): ...
|
||||
def copy(self) -> QueryDict: ...
|
||||
@classmethod
|
||||
def fromkeys(
|
||||
cls,
|
||||
iterable: Union[str, List[str]],
|
||||
value: str = ...,
|
||||
iterable: Union[int, List[bytes], str, List[str]],
|
||||
value: Union[str, bytes] = ...,
|
||||
mutable: bool = ...,
|
||||
encoding: None = ...,
|
||||
encoding: Optional[str] = ...,
|
||||
) -> QueryDict: ...
|
||||
def pop(self, key: str, *args) -> Optional[List[str]]: ...
|
||||
def popitem(self): ...
|
||||
def setdefault(self, key: str, default: str = ...) -> str: ...
|
||||
@property
|
||||
def encoding(self): ...
|
||||
@encoding.setter
|
||||
def encoding(self, value: Any) -> None: ...
|
||||
def __setitem__(
|
||||
self, key: str, value: Optional[Union[str, int]]
|
||||
) -> 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 setlistdefault(
|
||||
self, key: str, default_list: None = ...
|
||||
) -> List[str]: ...
|
||||
def appendlist(
|
||||
self, key: Union[str, bytes], value: Union[str, bytes, List[str]]
|
||||
) -> None: ...
|
||||
def pop(self, key: str, *args: Any) -> Optional[Union[str, List[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[str, bytes, int]], encoding: str
|
||||
) -> Optional[Union[str, int]]: ...
|
||||
def split_domain_port(host: str) -> Tuple[str, str]: ...
|
||||
def validate_host(host: str, allowed_hosts: Union[str, List[str]]) -> bool: ...
|
||||
|
||||
Reference in New Issue
Block a user