mirror of
https://github.com/davidhalter/django-stubs.git
synced 2026-02-25 02:57:14 +08:00
improved version
This commit is contained in:
@@ -25,7 +25,7 @@ def exhaust(stream_or_iterable: Union[BytesIO, WSGIRequest]) -> None: ...
|
||||
def parse_boundary_stream(
|
||||
stream: LazyStream,
|
||||
max_header_size: int
|
||||
) -> Union[Tuple[str, Dict[Any, Any], LazyStream], Tuple[str, Dict[str, Tuple[str, Dict[str, bytes]]], LazyStream], Tuple[str, Dict[str, Union[Tuple[str, Dict[str, bytes]], Tuple[str, Dict[Any, Any]]]], LazyStream], Tuple[str, Dict[str, Union[Tuple[str, Dict[str, str]], Tuple[str, Dict[Any, Any]]]], LazyStream]]: ...
|
||||
) -> Union[Tuple[str, Dict[str, Union[Tuple[str, Dict[str, bytes]], Tuple[str, Dict[Any, Any]]]], LazyStream], Tuple[str, Dict[str, Tuple[str, Dict[str, bytes]]], LazyStream], Tuple[str, Dict[Any, Any], LazyStream], Tuple[str, Dict[str, Union[Tuple[str, Dict[str, str]], Tuple[str, Dict[Any, Any]]]], LazyStream]]: ...
|
||||
|
||||
|
||||
def parse_header(line: bytes) -> Union[Tuple[str, Dict[Any, Any]], Tuple[str, Dict[str, bytes]]]: ...
|
||||
@@ -79,4 +79,4 @@ class Parser:
|
||||
def __init__(self, stream: LazyStream, boundary: bytes) -> None: ...
|
||||
def __iter__(
|
||||
self
|
||||
) -> Iterator[Union[Tuple[str, Dict[Any, Any], LazyStream], Tuple[str, Dict[str, Tuple[str, Dict[str, bytes]]], LazyStream], Tuple[str, Dict[str, Union[Tuple[str, Dict[str, bytes]], Tuple[str, Dict[Any, Any]]]], LazyStream]]]: ...
|
||||
) -> Iterator[Union[Tuple[str, Dict[Any, Any], LazyStream], Tuple[str, Dict[str, Union[Tuple[str, Dict[str, bytes]], Tuple[str, Dict[Any, Any]]]], LazyStream], Tuple[str, Dict[str, Tuple[str, Dict[str, bytes]]], LazyStream]]]: ...
|
||||
@@ -7,7 +7,6 @@ from django.core.files.base import ContentFile
|
||||
from django.core.serializers.json import DjangoJSONEncoder
|
||||
from tempfile import _TemporaryFileWrapper
|
||||
from typing import (
|
||||
Any,
|
||||
Dict,
|
||||
List,
|
||||
Optional,
|
||||
@@ -21,13 +20,13 @@ class FileResponse:
|
||||
def __init__(self, *args, as_attachment = ..., filename = ..., **kwargs) -> None: ...
|
||||
def _set_streaming_content(
|
||||
self,
|
||||
value: Union[BufferedReader, _TemporaryFileWrapper, ContentFile]
|
||||
value: Union[_TemporaryFileWrapper, BufferedReader, ContentFile]
|
||||
) -> None: ...
|
||||
def set_headers(self, filelike: Union[BufferedReader, BytesIO, _TemporaryFileWrapper]) -> None: ...
|
||||
def set_headers(self, filelike: Union[_TemporaryFileWrapper, BufferedReader, BytesIO]) -> None: ...
|
||||
|
||||
|
||||
class HttpResponse:
|
||||
def __init__(self, content: Any = ..., *args, **kwargs) -> None: ...
|
||||
def __init__(self, content: Union[int, TextIOWrapper, bytes, str] = ..., *args, **kwargs) -> None: ...
|
||||
def __repr__(self) -> str: ...
|
||||
def getvalue(self) -> bytes: ...
|
||||
def writable(self) -> bool: ...
|
||||
@@ -53,7 +52,7 @@ class HttpResponseBase:
|
||||
def delete_cookie(self, key: str, path: str = ..., domain: Optional[str] = ...) -> None: ...
|
||||
def get(self, header: str, alternate: Optional[Union[str, Tuple]] = ...) -> Optional[Union[str, Tuple]]: ...
|
||||
def has_header(self, header: str) -> bool: ...
|
||||
def make_bytes(self, value: Union[str, bytes, int]) -> bytes: ...
|
||||
def make_bytes(self, value: Union[bytes, int, str]) -> bytes: ...
|
||||
def seekable(self) -> bool: ...
|
||||
def serialize_headers(self) -> bytes: ...
|
||||
def set_cookie(
|
||||
@@ -92,7 +91,7 @@ class HttpResponseRedirectBase:
|
||||
class JsonResponse:
|
||||
def __init__(
|
||||
self,
|
||||
data: Dict[str, Union[Dict[str, str], str, List[Dict[str, str]], Dict[str, bool]]],
|
||||
data: Dict[str, Union[Dict[str, bool], str, Dict[str, str], List[Dict[str, str]]]],
|
||||
encoder: Type[DjangoJSONEncoder] = ...,
|
||||
safe: bool = ...,
|
||||
json_dumps_params: None = ...,
|
||||
@@ -103,11 +102,11 @@ class JsonResponse:
|
||||
class StreamingHttpResponse:
|
||||
def __init__(
|
||||
self,
|
||||
streaming_content: Union[List[str], BufferedReader, str, _TemporaryFileWrapper] = ...,
|
||||
streaming_content: Union[_TemporaryFileWrapper, BufferedReader, str, List[str]] = ...,
|
||||
*args,
|
||||
**kwargs
|
||||
) -> None: ...
|
||||
def __iter__(self) -> map: ...
|
||||
def _set_streaming_content(self, value: Union[TextIOWrapper, str, List[bytes], List[str]]) -> None: ...
|
||||
def _set_streaming_content(self, value: Union[TextIOWrapper, str, List[str], List[bytes]]) -> None: ...
|
||||
@property
|
||||
def content(self): ...
|
||||
Reference in New Issue
Block a user