mirror of
https://github.com/davidhalter/django-stubs.git
synced 2025-12-09 05:24:53 +08:00
fixes
This commit is contained in:
@@ -5,10 +5,10 @@ from django.http.response import HttpResponse, HttpResponseBase
|
|||||||
|
|
||||||
from django.urls import URLResolver, URLPattern
|
from django.urls import URLResolver, URLPattern
|
||||||
|
|
||||||
handler400 = ... # type: str
|
handler400: Callable[..., HttpResponse] = ...
|
||||||
handler403 = ... # type: str
|
handler403: Callable[..., HttpResponse] = ...
|
||||||
handler404 = ... # type: str
|
handler404: Callable[..., HttpResponse] = ...
|
||||||
handler500 = ... # type: str
|
handler500: Callable[..., HttpResponse] = ...
|
||||||
|
|
||||||
IncludedURLConf = Tuple[List[URLResolver], Optional[str], Optional[str]]
|
IncludedURLConf = Tuple[List[URLResolver], Optional[str], Optional[str]]
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
from typing import Any, Dict, Optional, Set, Tuple, Union
|
from typing import Any, Dict, Optional, Set, Tuple, Union, Sequence
|
||||||
|
|
||||||
from django.db import DefaultConnectionProxy
|
from django.db import DefaultConnectionProxy
|
||||||
from django.db.backends.base.base import BaseDatabaseWrapper
|
from django.db.backends.base.base import BaseDatabaseWrapper
|
||||||
@@ -34,4 +34,6 @@ class MigrationLoader:
|
|||||||
def build_graph(self) -> None: ...
|
def build_graph(self) -> None: ...
|
||||||
def check_consistent_history(self, connection: Any) -> None: ...
|
def check_consistent_history(self, connection: Any) -> None: ...
|
||||||
def detect_conflicts(self) -> Dict[str, Set[str]]: ...
|
def detect_conflicts(self) -> Dict[str, Set[str]]: ...
|
||||||
def project_state(self, nodes: Optional[Tuple[str, str]] = ..., at_end: bool = ...) -> ProjectState: ...
|
def project_state(
|
||||||
|
self, nodes: Optional[Tuple[str, str], Sequence[Tuple[str, str]]] = ..., at_end: bool = ...
|
||||||
|
) -> ProjectState: ...
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ from typing import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
from django.db.models.base import Model
|
from django.db.models.base import Model
|
||||||
from django.db.models.expressions import Combinable
|
from django.db.models.expressions import Combinable as Combinable, F as F
|
||||||
from django.db.models.sql.query import Query, RawQuery
|
from django.db.models.sql.query import Query, RawQuery
|
||||||
|
|
||||||
from django.db import models
|
from django.db import models
|
||||||
|
|||||||
@@ -27,3 +27,7 @@ class CsrfViewMiddleware(MiddlewareMixin):
|
|||||||
def process_response(self, request: HttpRequest, response: HttpResponseBase) -> HttpResponseBase: ...
|
def process_response(self, request: HttpRequest, response: HttpResponseBase) -> HttpResponseBase: ...
|
||||||
|
|
||||||
def _compare_salted_tokens(request_csrf_token: str, csrf_token: str) -> bool: ...
|
def _compare_salted_tokens(request_csrf_token: str, csrf_token: str) -> bool: ...
|
||||||
|
def _get_new_csrf_string() -> str: ...
|
||||||
|
def _salt_cipher_secret(secret: str) -> str: ...
|
||||||
|
def _unsalt_cipher_token(token: str) -> str: ...
|
||||||
|
def _get_new_csrf_token() -> str: ...
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
from typing import Any, Dict, List, Optional, Union
|
from typing import Any, Dict, List, Optional, Union
|
||||||
|
|
||||||
from django.http.request import HttpRequest
|
from django.http.request import HttpRequest
|
||||||
|
from django.template.exceptions import TemplateDoesNotExist as TemplateDoesNotExist
|
||||||
|
|
||||||
def get_template(template_name: str, using: Optional[str] = ...) -> Any: ...
|
def get_template(template_name: str, using: Optional[str] = ...) -> Any: ...
|
||||||
def select_template(template_name_list: Union[List[str], str], using: Optional[str] = ...) -> Any: ...
|
def select_template(template_name_list: Union[List[str], str], using: Optional[str] = ...) -> Any: ...
|
||||||
|
|||||||
@@ -11,7 +11,10 @@ from django.http.response import HttpResponse, HttpResponseBase
|
|||||||
|
|
||||||
from django.core.handlers.wsgi import WSGIRequest
|
from django.core.handlers.wsgi import WSGIRequest
|
||||||
|
|
||||||
CONTENT_TYPE_RE: Pattern
|
BOUNDARY: str = ...
|
||||||
|
MULTIPART_CONTENT: str = ...
|
||||||
|
CONTENT_TYPE_RE: Pattern = ...
|
||||||
|
JSON_CONTENT_TYPE_RE: Pattern = ...
|
||||||
|
|
||||||
class RedirectCycleError(Exception):
|
class RedirectCycleError(Exception):
|
||||||
last_response: HttpResponseBase = ...
|
last_response: HttpResponseBase = ...
|
||||||
|
|||||||
@@ -23,6 +23,8 @@ class ResolverMatch:
|
|||||||
namespaces: Optional[List[Optional[str]]] = ...,
|
namespaces: Optional[List[Optional[str]]] = ...,
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
def __getitem__(self, index: int) -> Any: ...
|
def __getitem__(self, index: int) -> Any: ...
|
||||||
|
# for tuple unpacking
|
||||||
|
def __iter__(self) -> Any: ...
|
||||||
|
|
||||||
def get_resolver(urlconf: Optional[str] = ...) -> URLResolver: ...
|
def get_resolver(urlconf: Optional[str] = ...) -> URLResolver: ...
|
||||||
def get_ns_resolver(ns_pattern: str, resolver: URLResolver, converters: Tuple) -> URLResolver: ...
|
def get_ns_resolver(ns_pattern: str, resolver: URLResolver, converters: Tuple) -> URLResolver: ...
|
||||||
|
|||||||
Reference in New Issue
Block a user