mirror of
https://github.com/davidhalter/django-stubs.git
synced 2025-12-23 20:31:32 +08:00
fourth iteration
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -39,34 +39,7 @@ class Template:
|
||||
context: Optional[
|
||||
Union[
|
||||
Dict[
|
||||
str,
|
||||
Dict[
|
||||
str,
|
||||
Optional[
|
||||
Union[
|
||||
Dict[str, int],
|
||||
List[
|
||||
Tuple[
|
||||
None,
|
||||
List[
|
||||
Dict[
|
||||
str,
|
||||
Union[
|
||||
Dict[Any, Any],
|
||||
time,
|
||||
int,
|
||||
str,
|
||||
],
|
||||
]
|
||||
],
|
||||
int,
|
||||
]
|
||||
],
|
||||
bool,
|
||||
str,
|
||||
]
|
||||
],
|
||||
],
|
||||
str, Dict[str, Optional[Union[Dict[str, bool], bool, str]]]
|
||||
],
|
||||
Dict[
|
||||
str,
|
||||
@@ -101,35 +74,19 @@ class Template:
|
||||
Union[
|
||||
Dict[Any, Any],
|
||||
List[
|
||||
Union[
|
||||
Tuple[
|
||||
None,
|
||||
List[
|
||||
Dict[
|
||||
Tuple[
|
||||
None,
|
||||
List[
|
||||
Dict[
|
||||
str,
|
||||
Union[
|
||||
Dict[str, bool],
|
||||
bool,
|
||||
str,
|
||||
Union[
|
||||
Dict[Any, Any],
|
||||
bool,
|
||||
str,
|
||||
],
|
||||
]
|
||||
],
|
||||
int,
|
||||
],
|
||||
Tuple[
|
||||
None,
|
||||
List[
|
||||
Dict[
|
||||
str,
|
||||
Union[
|
||||
Dict[str, bool],
|
||||
bool,
|
||||
str,
|
||||
],
|
||||
]
|
||||
],
|
||||
int,
|
||||
],
|
||||
]
|
||||
],
|
||||
int,
|
||||
]
|
||||
],
|
||||
List[str],
|
||||
@@ -152,16 +109,14 @@ class Template:
|
||||
Dict[Any, Any],
|
||||
List[
|
||||
Tuple[
|
||||
None,
|
||||
List[
|
||||
Dict[
|
||||
str,
|
||||
Union[
|
||||
Dict[Any, Any], bool, time, str
|
||||
],
|
||||
Union[Dict[Any, Any], bool, str],
|
||||
]
|
||||
],
|
||||
int,
|
||||
int,
|
||||
]
|
||||
],
|
||||
List[str],
|
||||
@@ -196,46 +151,24 @@ class Template:
|
||||
str,
|
||||
],
|
||||
],
|
||||
Dict[str, Union[Dict[Any, Any], bool, str]],
|
||||
Dict[
|
||||
str,
|
||||
Union[
|
||||
Dict[str, bool],
|
||||
List[
|
||||
Union[
|
||||
Tuple[
|
||||
None,
|
||||
List[
|
||||
Dict[
|
||||
Tuple[
|
||||
None,
|
||||
List[
|
||||
Dict[
|
||||
str,
|
||||
Union[
|
||||
Dict[str, bool],
|
||||
bool,
|
||||
str,
|
||||
Union[
|
||||
Dict[
|
||||
Any, Any
|
||||
],
|
||||
bool,
|
||||
str,
|
||||
],
|
||||
]
|
||||
],
|
||||
int,
|
||||
],
|
||||
Tuple[
|
||||
None,
|
||||
List[
|
||||
Dict[
|
||||
str,
|
||||
Union[
|
||||
Dict[
|
||||
str,
|
||||
bool,
|
||||
],
|
||||
bool,
|
||||
str,
|
||||
],
|
||||
]
|
||||
],
|
||||
int,
|
||||
],
|
||||
]
|
||||
],
|
||||
int,
|
||||
]
|
||||
],
|
||||
List[str],
|
||||
@@ -250,98 +183,6 @@ class Template:
|
||||
],
|
||||
],
|
||||
],
|
||||
Dict[
|
||||
str,
|
||||
Dict[
|
||||
str,
|
||||
Union[
|
||||
Dict[Any, Any],
|
||||
List[
|
||||
Union[
|
||||
Tuple[
|
||||
None,
|
||||
List[
|
||||
Dict[
|
||||
str,
|
||||
Union[
|
||||
Dict[Any, Any], bool, str
|
||||
],
|
||||
]
|
||||
],
|
||||
int,
|
||||
],
|
||||
Tuple[
|
||||
str,
|
||||
List[
|
||||
Dict[
|
||||
str,
|
||||
Union[
|
||||
Dict[Any, Any], bool, str
|
||||
],
|
||||
]
|
||||
],
|
||||
int,
|
||||
],
|
||||
]
|
||||
],
|
||||
List[str],
|
||||
bool,
|
||||
str,
|
||||
],
|
||||
],
|
||||
],
|
||||
Dict[
|
||||
str,
|
||||
Dict[
|
||||
str,
|
||||
Union[
|
||||
Dict[Any, Any],
|
||||
List[
|
||||
Union[
|
||||
Tuple[
|
||||
None,
|
||||
List[
|
||||
Dict[
|
||||
str,
|
||||
Union[
|
||||
Dict[Any, Any], bool, str
|
||||
],
|
||||
]
|
||||
],
|
||||
int,
|
||||
],
|
||||
Tuple[
|
||||
str,
|
||||
List[
|
||||
Union[
|
||||
Dict[
|
||||
str,
|
||||
Union[
|
||||
Dict[Any, Any],
|
||||
bool,
|
||||
str,
|
||||
],
|
||||
],
|
||||
Dict[
|
||||
str,
|
||||
Union[
|
||||
Dict[str, bool],
|
||||
bool,
|
||||
str,
|
||||
],
|
||||
],
|
||||
]
|
||||
],
|
||||
int,
|
||||
],
|
||||
]
|
||||
],
|
||||
List[str],
|
||||
bool,
|
||||
str,
|
||||
],
|
||||
],
|
||||
],
|
||||
Dict[
|
||||
str,
|
||||
Dict[
|
||||
@@ -389,31 +230,15 @@ class Template:
|
||||
Union[
|
||||
Dict[str, bool],
|
||||
List[
|
||||
Union[
|
||||
Tuple[
|
||||
None,
|
||||
List[
|
||||
Dict[
|
||||
str,
|
||||
Union[
|
||||
Dict[Any, Any], bool, str
|
||||
],
|
||||
]
|
||||
],
|
||||
int,
|
||||
],
|
||||
Tuple[
|
||||
None,
|
||||
List[
|
||||
Dict[
|
||||
str,
|
||||
Union[
|
||||
Dict[str, bool], bool, str
|
||||
],
|
||||
]
|
||||
],
|
||||
int,
|
||||
Tuple[
|
||||
List[
|
||||
Dict[
|
||||
str,
|
||||
Union[Dict[str, bool], bool, str],
|
||||
]
|
||||
],
|
||||
int,
|
||||
int,
|
||||
]
|
||||
],
|
||||
List[str],
|
||||
@@ -429,43 +254,41 @@ class Template:
|
||||
Union[
|
||||
Dict[str, bool],
|
||||
List[
|
||||
Union[
|
||||
Tuple[
|
||||
None,
|
||||
List[
|
||||
Dict[
|
||||
str,
|
||||
Union[
|
||||
Dict[str, bool], bool, str
|
||||
],
|
||||
]
|
||||
],
|
||||
int,
|
||||
Tuple[
|
||||
None,
|
||||
List[
|
||||
Dict[
|
||||
str,
|
||||
Union[Dict[str, bool], int, str],
|
||||
]
|
||||
],
|
||||
Tuple[
|
||||
str,
|
||||
List[
|
||||
int,
|
||||
]
|
||||
],
|
||||
List[str],
|
||||
bool,
|
||||
str,
|
||||
],
|
||||
],
|
||||
],
|
||||
Dict[
|
||||
str,
|
||||
Dict[
|
||||
str,
|
||||
Union[
|
||||
Dict[str, int],
|
||||
List[
|
||||
Tuple[
|
||||
None,
|
||||
List[
|
||||
Dict[
|
||||
str,
|
||||
Union[
|
||||
Dict[
|
||||
str,
|
||||
Union[
|
||||
Dict[Any, Any],
|
||||
bool,
|
||||
str,
|
||||
],
|
||||
],
|
||||
Dict[
|
||||
str,
|
||||
Union[
|
||||
Dict[str, bool],
|
||||
bool,
|
||||
str,
|
||||
],
|
||||
],
|
||||
]
|
||||
],
|
||||
int,
|
||||
Dict[Any, Any], time, int, str
|
||||
],
|
||||
]
|
||||
],
|
||||
int,
|
||||
]
|
||||
],
|
||||
List[str],
|
||||
@@ -494,29 +317,43 @@ class Template:
|
||||
Union[
|
||||
Dict[str, str],
|
||||
List[
|
||||
Union[
|
||||
Tuple[
|
||||
None,
|
||||
List[
|
||||
Dict[
|
||||
Tuple[
|
||||
None,
|
||||
List[
|
||||
Dict[
|
||||
str,
|
||||
Union[
|
||||
Dict[str, Union[bool, str]],
|
||||
bool,
|
||||
str,
|
||||
Union[Dict[Any, Any], int, str],
|
||||
]
|
||||
],
|
||||
int,
|
||||
],
|
||||
]
|
||||
],
|
||||
Tuple[
|
||||
None,
|
||||
List[
|
||||
Dict[
|
||||
str,
|
||||
Union[
|
||||
Dict[str, bool], int, str
|
||||
],
|
||||
]
|
||||
],
|
||||
int,
|
||||
int,
|
||||
]
|
||||
],
|
||||
List[str],
|
||||
bool,
|
||||
str,
|
||||
],
|
||||
],
|
||||
],
|
||||
Dict[
|
||||
str,
|
||||
Dict[
|
||||
str,
|
||||
Union[
|
||||
Dict[str, str],
|
||||
List[
|
||||
Tuple[
|
||||
None,
|
||||
List[
|
||||
Dict[
|
||||
str,
|
||||
Union[Dict[str, bool], int, str],
|
||||
]
|
||||
],
|
||||
int,
|
||||
]
|
||||
],
|
||||
List[str],
|
||||
@@ -534,7 +371,19 @@ class Template:
|
||||
List[
|
||||
Union[
|
||||
Tuple[
|
||||
None,
|
||||
List[
|
||||
Dict[
|
||||
str,
|
||||
Union[
|
||||
Dict[str, str], bool, str
|
||||
],
|
||||
]
|
||||
],
|
||||
int,
|
||||
int,
|
||||
],
|
||||
Tuple[
|
||||
str,
|
||||
List[
|
||||
Dict[
|
||||
str,
|
||||
@@ -547,13 +396,41 @@ class Template:
|
||||
],
|
||||
int,
|
||||
],
|
||||
]
|
||||
],
|
||||
List[str],
|
||||
bool,
|
||||
str,
|
||||
],
|
||||
],
|
||||
],
|
||||
Dict[
|
||||
str,
|
||||
Dict[
|
||||
str,
|
||||
Union[
|
||||
Dict[str, str],
|
||||
List[
|
||||
Union[
|
||||
Tuple[
|
||||
None,
|
||||
List[
|
||||
Dict[
|
||||
str,
|
||||
Union[
|
||||
Dict[str, str], bool, str
|
||||
Dict[Any, Any], bool, str
|
||||
],
|
||||
]
|
||||
],
|
||||
int,
|
||||
],
|
||||
Tuple[
|
||||
str,
|
||||
List[
|
||||
Dict[
|
||||
str,
|
||||
Union[
|
||||
Dict[str, bool], bool, str
|
||||
],
|
||||
]
|
||||
],
|
||||
@@ -593,34 +470,9 @@ class Template:
|
||||
Dict[
|
||||
str,
|
||||
Union[
|
||||
Dict[str, str], bool, str
|
||||
],
|
||||
]
|
||||
],
|
||||
int,
|
||||
],
|
||||
Tuple[
|
||||
str,
|
||||
List[
|
||||
Union[
|
||||
Dict[
|
||||
Dict[str, Union[bool, str]],
|
||||
bool,
|
||||
str,
|
||||
Union[
|
||||
Dict[
|
||||
str,
|
||||
Union[bool, str],
|
||||
],
|
||||
bool,
|
||||
str,
|
||||
],
|
||||
],
|
||||
Dict[
|
||||
str,
|
||||
Union[
|
||||
Dict[str, str],
|
||||
bool,
|
||||
str,
|
||||
],
|
||||
],
|
||||
]
|
||||
],
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,46 +1,9 @@
|
||||
from datetime import date, datetime, time, timedelta
|
||||
from datetime import date, time, timedelta
|
||||
from decimal import Decimal
|
||||
from io import BytesIO
|
||||
from sqlite3 import OperationalError
|
||||
from typing import (Any, Callable, Dict, Iterator, List, Optional, Tuple, Type,
|
||||
Union)
|
||||
from typing import Any, Callable, Dict, Iterator, List, Optional, Tuple, Union
|
||||
|
||||
from django.contrib.admin.helpers import AdminErrorList
|
||||
from django.contrib.admin.options import ModelAdmin
|
||||
from django.contrib.admin.templatetags.admin_list import ResultList
|
||||
from django.contrib.admin.templatetags.base import InclusionAdminNode
|
||||
from django.contrib.admin.views.main import ChangeList
|
||||
from django.contrib.auth.views import LoginView
|
||||
from django.core.files.uploadedfile import InMemoryUploadedFile
|
||||
from django.core.files.uploadhandler import FileUploadHandler
|
||||
from django.core.handlers.wsgi import WSGIRequest
|
||||
from django.db.backends.sqlite3.base import (DatabaseWrapper,
|
||||
SQLiteCursorWrapper)
|
||||
from django.db.backends.utils import CursorWrapper
|
||||
from django.db.models.base import Model
|
||||
from django.db.models.options import Options
|
||||
from django.db.models.query import QuerySet
|
||||
from django.db.utils import OperationalError
|
||||
from django.http.multipartparser import LazyStream, MultiPartParser
|
||||
from django.http.response import HttpResponse
|
||||
from django.template.backends.django import DjangoTemplates, Template
|
||||
from django.template.base import Node, Template
|
||||
from django.template.context import RequestContext
|
||||
from django.template.exceptions import TemplateDoesNotExist
|
||||
from django.template.loader_tags import BlockContext, BlockNode
|
||||
from django.test.client import FakePayload, RequestFactory
|
||||
from django.urls.resolvers import ResolverMatch, URLResolver
|
||||
from django.utils.datastructures import MultiValueDict
|
||||
from django.utils.feedgenerator import Enclosure, Rss201rev2Feed
|
||||
from django.utils.functional import cached_property
|
||||
from django.utils.safestring import SafeText
|
||||
from django.utils.xmlutils import SimplerXMLGenerator
|
||||
from django.views.debug import CallableSettingWrapper, ExceptionReporter
|
||||
from django.views.generic.base import TemplateResponseMixin, TemplateView
|
||||
from django.views.generic.dates import BaseDateDetailView
|
||||
from django.views.generic.detail import DetailView
|
||||
from django.views.generic.edit import DeleteView, ModelFormMixin
|
||||
from django.views.generic.list import MultipleObjectTemplateResponseMixin
|
||||
|
||||
from .base import Variable, VariableDoesNotExist
|
||||
from .library import Library
|
||||
@@ -53,7 +16,7 @@ def capfirst(value: str) -> str: ...
|
||||
def escapejs_filter(value: str) -> SafeText: ...
|
||||
def json_script(value: Dict[str, str], element_id: SafeText) -> SafeText: ...
|
||||
def floatformat(
|
||||
text: Optional[Union[Decimal, float, int, str]], arg: Union[int, str] = ...
|
||||
text: Optional[Union[Decimal, float, str]], arg: Union[int, str] = ...
|
||||
) -> str: ...
|
||||
def iriencode(value: str) -> str: ...
|
||||
def linenumbers(value: str, autoescape: bool = ...) -> SafeText: ...
|
||||
@@ -119,26 +82,11 @@ def last(value: List[str]) -> str: ...
|
||||
def length(
|
||||
value: Optional[
|
||||
Union[
|
||||
List[Optional[Union[Dict[Any, Any], int, str]]],
|
||||
AdminErrorList,
|
||||
QuerySet,
|
||||
int,
|
||||
str,
|
||||
List[Optional[Union[Dict[Any, Any], int, str]]], QuerySet, int, str
|
||||
]
|
||||
]
|
||||
) -> int: ...
|
||||
def length_is(
|
||||
value: Optional[
|
||||
Union[
|
||||
List[Callable],
|
||||
List[Optional[Union[Dict[Any, Any], int, str]]],
|
||||
Tuple[str, str],
|
||||
int,
|
||||
str,
|
||||
]
|
||||
],
|
||||
arg: Union[SafeText, int],
|
||||
) -> Union[bool, str]: ...
|
||||
def length_is(value: Any, arg: Union[SafeText, int]) -> Union[bool, str]: ...
|
||||
def random(value: List[str]) -> str: ...
|
||||
def slice_filter(value: Any, arg: str) -> Any: ...
|
||||
def unordered_list(
|
||||
@@ -179,118 +127,4 @@ def yesno(
|
||||
def filesizeformat(bytes_: Union[complex, int, str]) -> str: ...
|
||||
def pluralize(value: Any, arg: str = ...) -> str: ...
|
||||
def phone2numeric_filter(value: str) -> str: ...
|
||||
def pprint(
|
||||
value: Optional[
|
||||
Union[
|
||||
Callable,
|
||||
Dict[int, None],
|
||||
Dict[
|
||||
str, Optional[Union[List[Enclosure], List[str], datetime, str]]
|
||||
],
|
||||
Dict[str, Optional[Union[TemplateResponseMixin, int]]],
|
||||
Dict[
|
||||
str,
|
||||
Union[
|
||||
Dict[
|
||||
str,
|
||||
Optional[
|
||||
Union[Dict[Any, Any], Dict[str, None], int, str]
|
||||
],
|
||||
],
|
||||
Tuple[str, Dict[str, bytes]],
|
||||
],
|
||||
],
|
||||
Dict[
|
||||
str,
|
||||
Union[
|
||||
Dict[
|
||||
str,
|
||||
Union[
|
||||
Dict[str, Union[List[str], bool, str]],
|
||||
Dict[str, Union[List[str], str]],
|
||||
],
|
||||
],
|
||||
Dict[
|
||||
str,
|
||||
Union[Dict[str, Union[List[str], str]], Dict[str, str]],
|
||||
],
|
||||
date,
|
||||
int,
|
||||
],
|
||||
],
|
||||
Dict[str, Union[Dict[str, str], str]],
|
||||
Dict[str, Union[Tuple[int, int], BytesIO, FakePayload, int, str]],
|
||||
Dict[
|
||||
str,
|
||||
Union[django.db.backends.base.DatabaseWrapper, CursorWrapper],
|
||||
],
|
||||
Dict[str, bytes],
|
||||
Dict[str, Model],
|
||||
Dict[str, BlockNode],
|
||||
Exception,
|
||||
List[Callable],
|
||||
List[Dict[str, Union[Dict[str, List[str]], List[str], bool, str]]],
|
||||
List[Tuple[str, str]],
|
||||
List[ChangeList],
|
||||
List[DjangoTemplates],
|
||||
List[TemplateDoesNotExist],
|
||||
List[Enclosure],
|
||||
List[int],
|
||||
List[str],
|
||||
Tuple,
|
||||
Type[
|
||||
Union[
|
||||
ValueError,
|
||||
bool,
|
||||
ResultList,
|
||||
InclusionAdminNode,
|
||||
LoginView,
|
||||
OperationalError,
|
||||
URLResolver,
|
||||
MultiValueDict,
|
||||
TemplateView,
|
||||
BaseDateDetailView,
|
||||
DetailView,
|
||||
DeleteView,
|
||||
ModelFormMixin,
|
||||
MultipleObjectTemplateResponseMixin,
|
||||
OperationalError,
|
||||
]
|
||||
],
|
||||
BytesIO,
|
||||
bytes,
|
||||
date,
|
||||
ModelAdmin,
|
||||
ChangeList,
|
||||
InMemoryUploadedFile,
|
||||
FileUploadHandler,
|
||||
WSGIRequest,
|
||||
django.db.backends.base.SQLiteCursorWrapper,
|
||||
CursorWrapper,
|
||||
Model,
|
||||
Options,
|
||||
QuerySet,
|
||||
LazyStream,
|
||||
MultiPartParser,
|
||||
HttpResponse,
|
||||
DjangoTemplates,
|
||||
Template,
|
||||
Node,
|
||||
Template,
|
||||
RequestContext,
|
||||
BlockContext,
|
||||
FakePayload,
|
||||
RequestFactory,
|
||||
ResolverMatch,
|
||||
URLResolver,
|
||||
Rss201rev2Feed,
|
||||
cached_property,
|
||||
SimplerXMLGenerator,
|
||||
CallableSettingWrapper,
|
||||
ExceptionReporter,
|
||||
TemplateResponseMixin,
|
||||
int,
|
||||
str,
|
||||
]
|
||||
]
|
||||
) -> str: ...
|
||||
def pprint(value: Any) -> str: ...
|
||||
|
||||
@@ -1,24 +1,10 @@
|
||||
from collections import namedtuple
|
||||
from datetime import date, time
|
||||
from decimal import Decimal
|
||||
from sqlite3 import OperationalError
|
||||
from typing import Any, Dict, List, Optional, Set, Tuple, Union
|
||||
from datetime import date
|
||||
from typing import Any, Dict, List, Optional, Tuple, Union
|
||||
|
||||
from django.contrib.admin.helpers import ActionForm, AdminForm
|
||||
from django.contrib.auth.context_processors import PermLookupDict, PermWrapper
|
||||
from django.contrib.messages.storage.base import BaseStorage
|
||||
from django.core.exceptions import FieldDoesNotExist
|
||||
from django.core.handlers.wsgi import WSGIRequest
|
||||
from django.db.models.base import Model
|
||||
from django.db.models.fields import AutoField
|
||||
from django.db.models.query import QuerySet
|
||||
from django.forms.boundfield import BoundField
|
||||
from django.template.base import FilterExpression, NodeList, Parser, Token
|
||||
from django.template.context import Context, RequestContext
|
||||
from django.template.exceptions import TemplateDoesNotExist
|
||||
from django.template.library import Library
|
||||
from django.urls.resolvers import URLPattern, URLResolver
|
||||
from django.utils.datastructures import MultiValueDict
|
||||
from django.utils.safestring import SafeText
|
||||
|
||||
from .base import (BLOCK_TAG_END, BLOCK_TAG_START, COMMENT_TAG_END,
|
||||
@@ -144,19 +130,10 @@ class IfNode(Node):
|
||||
origin: django.template.base.Origin
|
||||
token: django.template.base.Token
|
||||
conditions_nodelists: List[
|
||||
Union[
|
||||
Tuple[None, django.template.base.NodeList],
|
||||
Tuple[
|
||||
django.template.defaulttags.TemplateLiteral,
|
||||
django.template.base.NodeList,
|
||||
],
|
||||
]
|
||||
Tuple[django.template.base.NodeList, django.template.base.NodeList]
|
||||
] = ...
|
||||
def __init__(
|
||||
self,
|
||||
conditions_nodelists: List[
|
||||
Union[Tuple[None, NodeList], Tuple[TemplateLiteral, NodeList]]
|
||||
],
|
||||
self, conditions_nodelists: List[Tuple[NodeList, NodeList]]
|
||||
) -> None: ...
|
||||
def __iter__(self) -> None: ...
|
||||
@property
|
||||
@@ -308,50 +285,7 @@ class TemplateLiteral(Literal):
|
||||
text: str = ...
|
||||
def __init__(self, value: FilterExpression, text: str) -> None: ...
|
||||
def display(self) -> str: ...
|
||||
def eval(
|
||||
self, context: Context
|
||||
) -> Optional[
|
||||
Union[
|
||||
AttributeError,
|
||||
Dict[str, Union[List[Tuple[int, SafeText]], int, str]],
|
||||
KeyError,
|
||||
List[List[Union[URLPattern, URLResolver]]],
|
||||
List[Tuple[str, str]],
|
||||
List[
|
||||
Union[
|
||||
Dict[str, Union[List[Any], str]],
|
||||
Dict[
|
||||
str, Union[List[Dict[str, Union[List[Any], str]]], str]
|
||||
],
|
||||
]
|
||||
],
|
||||
List[BoundField],
|
||||
List[TemplateDoesNotExist],
|
||||
List[int],
|
||||
List[str],
|
||||
Set[Any],
|
||||
Tuple,
|
||||
TypeError,
|
||||
date,
|
||||
time,
|
||||
Decimal,
|
||||
ActionForm,
|
||||
AdminForm,
|
||||
PermLookupDict,
|
||||
PermWrapper,
|
||||
BaseStorage,
|
||||
FieldDoesNotExist,
|
||||
WSGIRequest,
|
||||
Model,
|
||||
AutoField,
|
||||
QuerySet,
|
||||
MultiValueDict,
|
||||
float,
|
||||
int,
|
||||
OperationalError,
|
||||
str,
|
||||
]
|
||||
]: ...
|
||||
def eval(self, context: Context) -> Any: ...
|
||||
|
||||
class TemplateIfParser(IfParser):
|
||||
current_token: django.template.defaulttags.TemplateLiteral
|
||||
|
||||
@@ -29,7 +29,6 @@ class Engine:
|
||||
str,
|
||||
Union[
|
||||
Dict[str, str],
|
||||
List[Any],
|
||||
List[Tuple[str, Dict[str, str]]],
|
||||
List[str],
|
||||
],
|
||||
@@ -59,7 +58,6 @@ class Engine:
|
||||
str,
|
||||
Union[
|
||||
Dict[str, str],
|
||||
List[Any],
|
||||
List[Tuple[str, Dict[str, str]]],
|
||||
List[str],
|
||||
],
|
||||
@@ -93,7 +91,6 @@ class Engine:
|
||||
str,
|
||||
Union[
|
||||
Dict[str, str],
|
||||
List[Any],
|
||||
List[Tuple[str, Dict[str, str]]],
|
||||
List[str],
|
||||
],
|
||||
@@ -133,10 +130,9 @@ class Engine:
|
||||
Dict[str, Dict[str, List[Tuple[str, int]]]],
|
||||
Dict[str, Dict[str, Tuple[str, str, str, str]]],
|
||||
Dict[str, List[Dict[str, Union[List[int], int]]]],
|
||||
Dict[str, List[Dict[str, Union[List[str], str]]]],
|
||||
Dict[str, List[Dict[str, Union[int, str]]]],
|
||||
Dict[str, List[Dict[str, date]]],
|
||||
Dict[str, List[List[Tuple[int, str]]]],
|
||||
Dict[str, List[Union[List[SafeText], str]]],
|
||||
Dict[str, List[Template]],
|
||||
Dict[str, Optional[int]],
|
||||
Dict[str, Optional[str]],
|
||||
@@ -155,15 +151,28 @@ class Engine:
|
||||
Dict[str, Union[Dict[str, int], str]],
|
||||
Dict[
|
||||
str,
|
||||
Union[List[Optional[Union[Dict[Any, Any], int, str]]], int],
|
||||
Union[
|
||||
List[
|
||||
Optional[
|
||||
Union[
|
||||
Dict[str, Union[List[str], str]], int, str
|
||||
]
|
||||
]
|
||||
],
|
||||
str,
|
||||
],
|
||||
],
|
||||
Dict[
|
||||
str,
|
||||
Union[
|
||||
List[Optional[Union[Dict[str, date], int, str]]], int
|
||||
],
|
||||
],
|
||||
Dict[str, Union[List[Union[List[SafeText], str]], str]],
|
||||
Dict[str, Union[List[int], str]],
|
||||
Dict[str, Union[date, timedelta]],
|
||||
Dict[str, Union[float, int]],
|
||||
Dict[str, Union[int, str]],
|
||||
Dict[str, time],
|
||||
Dict[str, Template],
|
||||
Dict[str, float],
|
||||
Dict[str, range],
|
||||
]
|
||||
] = ...,
|
||||
|
||||
@@ -55,9 +55,9 @@ class TagHelperNode(Node):
|
||||
) -> None: ...
|
||||
def get_resolved_arguments(
|
||||
self, context: Context
|
||||
) -> Union[
|
||||
Tuple[Dict[Any, Any], Dict[Any, Any]],
|
||||
Tuple[List[int], Dict[str, Union[SafeText, int]]],
|
||||
) -> Tuple[
|
||||
Union[Dict[str, Union[SafeText, int]], List[Union[Context, int]]],
|
||||
Union[Dict[Any, Any], Dict[str, Union[SafeText, int]], Dict[str, int]],
|
||||
]: ...
|
||||
|
||||
class SimpleNode(TagHelperNode):
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
from datetime import date, datetime
|
||||
from datetime import datetime
|
||||
from typing import Any, Callable, Dict, List, Optional, Tuple, Union
|
||||
from unittest.mock import MagicMock
|
||||
|
||||
from django.contrib.auth.forms import AuthenticationForm
|
||||
from django.contrib.auth.views import LoginView
|
||||
from django.contrib.sites.requests import RequestSite
|
||||
from django.core.paginator import Page, Paginator
|
||||
from django.db.models.base import Model
|
||||
from django.db.models.query import QuerySet
|
||||
from django.forms.forms import BaseForm
|
||||
from django.http import HttpResponse
|
||||
from django.http.request import HttpRequest
|
||||
@@ -13,8 +14,7 @@ from django.template.backends.django import Template
|
||||
from django.template.backends.jinja2 import Template
|
||||
from django.views.generic.base import TemplateResponseMixin
|
||||
from django.views.generic.detail import DetailView
|
||||
from django.views.generic.list import (ListView,
|
||||
MultipleObjectTemplateResponseMixin)
|
||||
from django.views.generic.list import ListView
|
||||
|
||||
from .loader import get_template, select_template
|
||||
|
||||
@@ -38,19 +38,17 @@ class SimpleTemplateResponse(HttpResponse):
|
||||
template: Union[List[str], Template, str],
|
||||
context: Optional[
|
||||
Union[
|
||||
Dict[
|
||||
str, Optional[Union[List[Dict[str, str]], bool, ListView]]
|
||||
],
|
||||
Dict[str, Any],
|
||||
Dict[str, List[Dict[str, Any]]],
|
||||
Dict[
|
||||
str,
|
||||
Optional[
|
||||
Union[
|
||||
List[
|
||||
Dict[str, Optional[Union[datetime, Model, str]]]
|
||||
],
|
||||
bool,
|
||||
date,
|
||||
Page,
|
||||
Paginator,
|
||||
QuerySet,
|
||||
MultipleObjectTemplateResponseMixin,
|
||||
ListView,
|
||||
]
|
||||
],
|
||||
],
|
||||
@@ -59,17 +57,12 @@ class SimpleTemplateResponse(HttpResponse):
|
||||
Dict[
|
||||
str,
|
||||
Union[
|
||||
List[Dict[str, Optional[Union[datetime, Model, str]]]],
|
||||
bool,
|
||||
Page,
|
||||
Paginator,
|
||||
ListView,
|
||||
List[Dict[str, str]], bool, Page, Paginator, ListView
|
||||
],
|
||||
],
|
||||
Dict[str, Union[List[str], str]],
|
||||
Dict[
|
||||
str,
|
||||
Union[RequestSite, BaseForm, TemplateResponseMixin, str],
|
||||
str, Union[AuthenticationForm, LoginView, RequestSite, str]
|
||||
],
|
||||
Dict[str, Union[Model, BaseForm, TemplateResponseMixin, str]],
|
||||
MagicMock,
|
||||
@@ -87,19 +80,17 @@ class SimpleTemplateResponse(HttpResponse):
|
||||
self,
|
||||
context: Optional[
|
||||
Union[
|
||||
Dict[
|
||||
str, Optional[Union[List[Dict[str, str]], bool, ListView]]
|
||||
],
|
||||
Dict[str, Any],
|
||||
Dict[str, List[Dict[str, Any]]],
|
||||
Dict[
|
||||
str,
|
||||
Optional[
|
||||
Union[
|
||||
List[
|
||||
Dict[str, Optional[Union[datetime, Model, str]]]
|
||||
],
|
||||
bool,
|
||||
date,
|
||||
Page,
|
||||
Paginator,
|
||||
QuerySet,
|
||||
MultipleObjectTemplateResponseMixin,
|
||||
ListView,
|
||||
]
|
||||
],
|
||||
],
|
||||
@@ -108,17 +99,12 @@ class SimpleTemplateResponse(HttpResponse):
|
||||
Dict[
|
||||
str,
|
||||
Union[
|
||||
List[Dict[str, Optional[Union[datetime, Model, str]]]],
|
||||
bool,
|
||||
Page,
|
||||
Paginator,
|
||||
ListView,
|
||||
List[Dict[str, str]], bool, Page, Paginator, ListView
|
||||
],
|
||||
],
|
||||
Dict[str, Union[List[str], str]],
|
||||
Dict[
|
||||
str,
|
||||
Union[RequestSite, BaseForm, TemplateResponseMixin, str],
|
||||
str, Union[AuthenticationForm, LoginView, RequestSite, str]
|
||||
],
|
||||
Dict[str, Union[Model, BaseForm, TemplateResponseMixin, str]],
|
||||
MagicMock,
|
||||
@@ -126,17 +112,15 @@ class SimpleTemplateResponse(HttpResponse):
|
||||
],
|
||||
) -> Optional[
|
||||
Union[
|
||||
Dict[str, Optional[Union[List[Dict[str, str]], bool, ListView]]],
|
||||
Dict[str, Any],
|
||||
Dict[str, List[Dict[str, Any]]],
|
||||
Dict[
|
||||
str,
|
||||
Optional[
|
||||
Union[
|
||||
List[Dict[str, Optional[Union[datetime, Model, str]]]],
|
||||
bool,
|
||||
date,
|
||||
Page,
|
||||
Paginator,
|
||||
QuerySet,
|
||||
MultipleObjectTemplateResponseMixin,
|
||||
ListView,
|
||||
]
|
||||
],
|
||||
],
|
||||
@@ -144,16 +128,10 @@ class SimpleTemplateResponse(HttpResponse):
|
||||
Dict[str, Union[Dict[str, str], DetailView]],
|
||||
Dict[
|
||||
str,
|
||||
Union[
|
||||
List[Dict[str, Optional[Union[datetime, Model, str]]]],
|
||||
bool,
|
||||
Page,
|
||||
Paginator,
|
||||
ListView,
|
||||
],
|
||||
Union[List[Dict[str, str]], bool, Page, Paginator, ListView],
|
||||
],
|
||||
Dict[str, Union[List[str], str]],
|
||||
Dict[str, Union[RequestSite, BaseForm, TemplateResponseMixin, str]],
|
||||
Dict[str, Union[AuthenticationForm, LoginView, RequestSite, str]],
|
||||
Dict[str, Union[Model, BaseForm, TemplateResponseMixin, str]],
|
||||
MagicMock,
|
||||
]
|
||||
@@ -177,29 +155,29 @@ class TemplateResponse(SimpleTemplateResponse):
|
||||
context: django.template.context.RequestContext
|
||||
context_data: Optional[
|
||||
Union[
|
||||
Dict[str, Any],
|
||||
Dict[str, List[Dict[str, Any]]],
|
||||
Dict[
|
||||
str,
|
||||
Optional[
|
||||
Union[
|
||||
List[Dict[str, str]],
|
||||
List[
|
||||
Dict[
|
||||
str,
|
||||
Optional[
|
||||
Union[
|
||||
datetime.datetime,
|
||||
django.db.models.base.Model,
|
||||
str,
|
||||
]
|
||||
],
|
||||
]
|
||||
],
|
||||
bool,
|
||||
django.views.generic.list.ListView,
|
||||
]
|
||||
],
|
||||
],
|
||||
Dict[
|
||||
str,
|
||||
Optional[
|
||||
Union[
|
||||
bool,
|
||||
datetime.date,
|
||||
django.core.paginator.Page,
|
||||
django.core.paginator.Paginator,
|
||||
django.db.models.query.QuerySet,
|
||||
django.views.generic.list.MultipleObjectTemplateResponseMixin,
|
||||
]
|
||||
],
|
||||
],
|
||||
Dict[str, Union[Callable, int]],
|
||||
Dict[
|
||||
str,
|
||||
@@ -208,18 +186,7 @@ class TemplateResponse(SimpleTemplateResponse):
|
||||
Dict[
|
||||
str,
|
||||
Union[
|
||||
List[
|
||||
Dict[
|
||||
str,
|
||||
Optional[
|
||||
Union[
|
||||
datetime.datetime,
|
||||
django.db.models.base.Model,
|
||||
str,
|
||||
]
|
||||
],
|
||||
]
|
||||
],
|
||||
List[Dict[str, str]],
|
||||
bool,
|
||||
django.core.paginator.Page,
|
||||
django.core.paginator.Paginator,
|
||||
@@ -230,9 +197,9 @@ class TemplateResponse(SimpleTemplateResponse):
|
||||
Dict[
|
||||
str,
|
||||
Union[
|
||||
django.contrib.auth.forms.AuthenticationForm,
|
||||
django.contrib.auth.views.LoginView,
|
||||
django.contrib.sites.requests.RequestSite,
|
||||
django.forms.forms.BaseForm,
|
||||
django.views.generic.base.TemplateResponseMixin,
|
||||
str,
|
||||
],
|
||||
],
|
||||
@@ -268,19 +235,17 @@ class TemplateResponse(SimpleTemplateResponse):
|
||||
template: Union[List[str], Template, str],
|
||||
context: Optional[
|
||||
Union[
|
||||
Dict[
|
||||
str, Optional[Union[List[Dict[str, str]], bool, ListView]]
|
||||
],
|
||||
Dict[str, Any],
|
||||
Dict[str, List[Dict[str, Any]]],
|
||||
Dict[
|
||||
str,
|
||||
Optional[
|
||||
Union[
|
||||
List[
|
||||
Dict[str, Optional[Union[datetime, Model, str]]]
|
||||
],
|
||||
bool,
|
||||
date,
|
||||
Page,
|
||||
Paginator,
|
||||
QuerySet,
|
||||
MultipleObjectTemplateResponseMixin,
|
||||
ListView,
|
||||
]
|
||||
],
|
||||
],
|
||||
@@ -289,17 +254,12 @@ class TemplateResponse(SimpleTemplateResponse):
|
||||
Dict[
|
||||
str,
|
||||
Union[
|
||||
List[Dict[str, Optional[Union[datetime, Model, str]]]],
|
||||
bool,
|
||||
Page,
|
||||
Paginator,
|
||||
ListView,
|
||||
List[Dict[str, str]], bool, Page, Paginator, ListView
|
||||
],
|
||||
],
|
||||
Dict[str, Union[List[str], str]],
|
||||
Dict[
|
||||
str,
|
||||
Union[RequestSite, BaseForm, TemplateResponseMixin, str],
|
||||
str, Union[AuthenticationForm, LoginView, RequestSite, str]
|
||||
],
|
||||
Dict[str, Union[Model, BaseForm, TemplateResponseMixin, str]],
|
||||
MagicMock,
|
||||
|
||||
Reference in New Issue
Block a user