mirror of
https://github.com/davidhalter/django-stubs.git
synced 2025-12-07 20:54:29 +08:00
92 lines
3.0 KiB
Python
92 lines
3.0 KiB
Python
from django.core.handlers.wsgi import WSGIRequest
|
|
from django.utils.datastructures import MultiValueDict
|
|
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: ...
|
|
|
|
|
|
class HttpRequest:
|
|
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_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: ...
|
|
@property
|
|
def scheme(self) -> Optional[str]: ...
|
|
|
|
|
|
class QueryDict:
|
|
def __copy__(self) -> QueryDict: ...
|
|
def __deepcopy__(self, memo: Dict[Any, Any]) -> QueryDict: ...
|
|
def __delitem__(self, key: str): ...
|
|
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 = ...,
|
|
mutable: bool = ...,
|
|
encoding: None = ...
|
|
) -> QueryDict: ...
|
|
def pop(self, key: str, *args) -> Optional[List[str]]: ...
|
|
def popitem(self): ...
|
|
def setdefault(self, key: str, default: str = ...) -> str: ...
|
|
def setlist(self, key: str, list_: List[str]) -> None: ...
|
|
def setlistdefault(self, key: str, default_list: None = ...) -> List[str]: ...
|
|
def urlencode(self, safe: Optional[str] = ...) -> str: ... |