This commit is contained in:
Maxim Kurnikov
2019-02-06 20:46:05 +03:00
parent d18fc0bf5f
commit 0c121d65d1
7 changed files with 20 additions and 8 deletions

View File

@@ -5,10 +5,10 @@ from django.http.response import HttpResponse, HttpResponseBase
from django.urls import URLResolver, URLPattern
handler400 = ... # type: str
handler403 = ... # type: str
handler404 = ... # type: str
handler500 = ... # type: str
handler400: Callable[..., HttpResponse] = ...
handler403: Callable[..., HttpResponse] = ...
handler404: Callable[..., HttpResponse] = ...
handler500: Callable[..., HttpResponse] = ...
IncludedURLConf = Tuple[List[URLResolver], Optional[str], Optional[str]]

View File

@@ -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.backends.base.base import BaseDatabaseWrapper
@@ -34,4 +34,6 @@ class MigrationLoader:
def build_graph(self) -> None: ...
def check_consistent_history(self, connection: Any) -> None: ...
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: ...

View File

@@ -16,7 +16,7 @@ from typing import (
)
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 import models

View File

@@ -27,3 +27,7 @@ class CsrfViewMiddleware(MiddlewareMixin):
def process_response(self, request: HttpRequest, response: HttpResponseBase) -> HttpResponseBase: ...
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: ...

View File

@@ -1,6 +1,7 @@
from typing import Any, Dict, List, Optional, Union
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 select_template(template_name_list: Union[List[str], str], using: Optional[str] = ...) -> Any: ...

View File

@@ -11,7 +11,10 @@ from django.http.response import HttpResponse, HttpResponseBase
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):
last_response: HttpResponseBase = ...

View File

@@ -23,6 +23,8 @@ class ResolverMatch:
namespaces: Optional[List[Optional[str]]] = ...,
) -> None: ...
def __getitem__(self, index: int) -> Any: ...
# for tuple unpacking
def __iter__(self) -> Any: ...
def get_resolver(urlconf: Optional[str] = ...) -> URLResolver: ...
def get_ns_resolver(ns_pattern: str, resolver: URLResolver, converters: Tuple) -> URLResolver: ...