mirror of
https://github.com/davidhalter/django-stubs.git
synced 2025-12-08 13:04:47 +08:00
move generated stubs to separate directory, too messty
This commit is contained in:
0
django-stubs-generated/template/__init__.pyi
Normal file
0
django-stubs-generated/template/__init__.pyi
Normal file
16
django-stubs-generated/template/backends/base.pyi
Normal file
16
django-stubs-generated/template/backends/base.pyi
Normal file
@@ -0,0 +1,16 @@
|
||||
from typing import Any, Dict, Iterator, List, Optional, Tuple, Union
|
||||
|
||||
|
||||
class BaseEngine:
|
||||
name: Any = ...
|
||||
dirs: Any = ...
|
||||
app_dirs: Any = ...
|
||||
def __init__(
|
||||
self, params: Dict[str, Union[List[str], bool, str]]
|
||||
) -> None: ...
|
||||
@property
|
||||
def app_dirname(self) -> None: ...
|
||||
def from_string(self, template_code: Any) -> None: ...
|
||||
def get_template(self, template_name: Any) -> None: ...
|
||||
def template_dirs(self) -> Tuple[str]: ...
|
||||
def iter_template_filenames(self, template_name: str) -> Iterator[str]: ...
|
||||
41
django-stubs-generated/template/backends/django.pyi
Normal file
41
django-stubs-generated/template/backends/django.pyi
Normal file
@@ -0,0 +1,41 @@
|
||||
from typing import Any, Dict, Iterator, Optional
|
||||
|
||||
from django.http.request import HttpRequest
|
||||
from django.template.base import Origin, Template
|
||||
from django.template.exceptions import TemplateDoesNotExist
|
||||
from django.utils.safestring import SafeText
|
||||
|
||||
from .base import BaseEngine
|
||||
|
||||
|
||||
class DjangoTemplates(BaseEngine):
|
||||
app_dirs: bool
|
||||
dirs: List[str]
|
||||
name: str
|
||||
app_dirname: str = ...
|
||||
engine: django.template.engine.Engine = ...
|
||||
def __init__(self, params: Dict[str, Any]) -> None: ...
|
||||
def from_string(self, template_code: str) -> Template: ...
|
||||
def get_template(self, template_name: str) -> Template: ...
|
||||
def get_templatetag_libraries(
|
||||
self, custom_libraries: Dict[str, str]
|
||||
) -> Dict[str, str]: ...
|
||||
|
||||
class Template:
|
||||
template: django.template.base.Template = ...
|
||||
backend: django.template.backends.django.DjangoTemplates = ...
|
||||
def __init__(
|
||||
self, template: Template, backend: DjangoTemplates
|
||||
) -> None: ...
|
||||
@property
|
||||
def origin(self) -> Origin: ...
|
||||
def render(
|
||||
self, context: Any = ..., request: Optional[HttpRequest] = ...
|
||||
) -> SafeText: ...
|
||||
|
||||
def copy_exception(
|
||||
exc: TemplateDoesNotExist, backend: Optional[DjangoTemplates] = ...
|
||||
) -> TemplateDoesNotExist: ...
|
||||
def reraise(exc: TemplateDoesNotExist, backend: DjangoTemplates) -> Any: ...
|
||||
def get_installed_libraries() -> Dict[str, str]: ...
|
||||
def get_package_libraries(pkg: Any) -> Iterator[str]: ...
|
||||
28
django-stubs-generated/template/backends/dummy.pyi
Normal file
28
django-stubs-generated/template/backends/dummy.pyi
Normal file
@@ -0,0 +1,28 @@
|
||||
import string
|
||||
from typing import Any, Dict, List, Optional, Union
|
||||
|
||||
from django.http.request import HttpRequest
|
||||
|
||||
from .base import BaseEngine
|
||||
from .utils import csrf_input_lazy, csrf_token_lazy
|
||||
|
||||
|
||||
class TemplateStrings(BaseEngine):
|
||||
app_dirs: bool
|
||||
dirs: List[Any]
|
||||
name: str
|
||||
template_dirs: Tuple[str]
|
||||
app_dirname: str = ...
|
||||
def __init__(
|
||||
self, params: Dict[str, Union[Dict[Any, Any], List[Any], bool, str]]
|
||||
) -> None: ...
|
||||
def from_string(self, template_code: str) -> Template: ...
|
||||
def get_template(self, template_name: str) -> Template: ...
|
||||
|
||||
class Template(string.Template):
|
||||
template: str
|
||||
def render(
|
||||
self,
|
||||
context: Optional[Dict[str, str]] = ...,
|
||||
request: Optional[HttpRequest] = ...,
|
||||
) -> str: ...
|
||||
171
django-stubs-generated/template/backends/jinja2.pyi
Normal file
171
django-stubs-generated/template/backends/jinja2.pyi
Normal file
@@ -0,0 +1,171 @@
|
||||
from datetime import time
|
||||
from typing import Any, Callable, Dict, List, Optional, Tuple, Union
|
||||
|
||||
from jinja2.environment import Template
|
||||
from jinja2.exceptions import TemplateSyntaxError
|
||||
|
||||
from django.http.request import HttpRequest
|
||||
from django.views.generic.base import TemplateView
|
||||
|
||||
from .base import BaseEngine
|
||||
|
||||
|
||||
class Jinja2(BaseEngine):
|
||||
app_dirs: bool
|
||||
dirs: List[str]
|
||||
name: str
|
||||
template_context_processors: List[Callable]
|
||||
template_dirs: Tuple[str]
|
||||
app_dirname: str = ...
|
||||
context_processors: List[str] = ...
|
||||
env: jinja2.environment.Environment = ...
|
||||
def __init__(
|
||||
self,
|
||||
params: Dict[
|
||||
str, Union[Dict[str, Union[List[str], bool]], List[str], bool, str]
|
||||
],
|
||||
) -> None: ...
|
||||
def from_string(self, template_code: str) -> Template: ...
|
||||
def get_template(self, template_name: str) -> Template: ...
|
||||
def template_context_processors(self) -> List[Callable]: ...
|
||||
|
||||
class Template:
|
||||
template: jinja2.environment.Template = ...
|
||||
backend: django.template.backends.jinja2.Jinja2 = ...
|
||||
origin: django.template.backends.jinja2.Origin = ...
|
||||
def __init__(self, template: Template, backend: Jinja2) -> None: ...
|
||||
def render(
|
||||
self,
|
||||
context: Optional[
|
||||
Union[
|
||||
Dict[
|
||||
str, Dict[str, Optional[Union[Dict[str, bool], bool, str]]]
|
||||
],
|
||||
Dict[
|
||||
str,
|
||||
Dict[
|
||||
str,
|
||||
Optional[
|
||||
Union[
|
||||
Dict[str, str],
|
||||
List[
|
||||
Dict[
|
||||
str,
|
||||
Optional[
|
||||
Union[Dict[str, str], bool, str]
|
||||
],
|
||||
]
|
||||
],
|
||||
bool,
|
||||
str,
|
||||
]
|
||||
],
|
||||
],
|
||||
],
|
||||
Dict[
|
||||
str,
|
||||
Dict[
|
||||
str,
|
||||
Union[
|
||||
Dict[str, int],
|
||||
List[
|
||||
Tuple[
|
||||
Optional[str],
|
||||
List[
|
||||
Dict[
|
||||
str,
|
||||
Union[Dict[str, bool], bool, str],
|
||||
]
|
||||
],
|
||||
int,
|
||||
]
|
||||
],
|
||||
List[str],
|
||||
bool,
|
||||
str,
|
||||
],
|
||||
],
|
||||
],
|
||||
Dict[
|
||||
str,
|
||||
Dict[
|
||||
str,
|
||||
Union[
|
||||
Dict[str, str],
|
||||
List[
|
||||
Dict[
|
||||
str,
|
||||
Union[
|
||||
Dict[str, str],
|
||||
List[
|
||||
Tuple[
|
||||
None,
|
||||
List[
|
||||
Dict[
|
||||
str,
|
||||
Union[
|
||||
Dict[str, bool],
|
||||
bool,
|
||||
str,
|
||||
],
|
||||
]
|
||||
],
|
||||
int,
|
||||
]
|
||||
],
|
||||
List[str],
|
||||
bool,
|
||||
str,
|
||||
],
|
||||
]
|
||||
],
|
||||
List[str],
|
||||
bool,
|
||||
str,
|
||||
],
|
||||
],
|
||||
],
|
||||
Dict[
|
||||
str,
|
||||
Dict[
|
||||
str,
|
||||
Union[
|
||||
Dict[str, str],
|
||||
List[
|
||||
Tuple[
|
||||
Optional[str],
|
||||
List[
|
||||
Dict[
|
||||
str,
|
||||
Union[
|
||||
Dict[str, Union[bool, str]],
|
||||
time,
|
||||
int,
|
||||
str,
|
||||
],
|
||||
]
|
||||
],
|
||||
int,
|
||||
]
|
||||
],
|
||||
List[str],
|
||||
bool,
|
||||
str,
|
||||
],
|
||||
],
|
||||
],
|
||||
Dict[str, TemplateView],
|
||||
Dict[str, str],
|
||||
]
|
||||
] = ...,
|
||||
request: Optional[HttpRequest] = ...,
|
||||
) -> str: ...
|
||||
|
||||
class Origin:
|
||||
name: str = ...
|
||||
template_name: Optional[str] = ...
|
||||
def __init__(self, name: str, template_name: Optional[str]) -> None: ...
|
||||
|
||||
def get_exception_info(
|
||||
exception: TemplateSyntaxError
|
||||
) -> Dict[str, Union[List[Tuple[int, str]], int, str]]: ...
|
||||
10
django-stubs-generated/template/backends/utils.pyi
Normal file
10
django-stubs-generated/template/backends/utils.pyi
Normal file
@@ -0,0 +1,10 @@
|
||||
from typing import Any, Optional
|
||||
|
||||
from django.http.request import HttpRequest
|
||||
from django.utils.safestring import SafeText
|
||||
|
||||
|
||||
def csrf_input(request: HttpRequest) -> SafeText: ...
|
||||
|
||||
csrf_input_lazy: Any
|
||||
csrf_token_lazy: Any
|
||||
234
django-stubs-generated/template/base.pyi
Normal file
234
django-stubs-generated/template/base.pyi
Normal file
@@ -0,0 +1,234 @@
|
||||
from enum import Enum
|
||||
from typing import (Any, Callable, Dict, Iterator, List, Optional, Tuple, Type,
|
||||
Union)
|
||||
|
||||
from django.template.backends.dummy import TemplateStrings
|
||||
from django.template.context import Context
|
||||
from django.template.engine import Engine
|
||||
from django.template.library import Library
|
||||
from django.template.loaders.base import Loader
|
||||
from django.utils.safestring import SafeText
|
||||
|
||||
from .exceptions import TemplateSyntaxError
|
||||
|
||||
FILTER_SEPARATOR: str
|
||||
FILTER_ARGUMENT_SEPARATOR: str
|
||||
VARIABLE_ATTRIBUTE_SEPARATOR: str
|
||||
BLOCK_TAG_START: str
|
||||
BLOCK_TAG_END: str
|
||||
VARIABLE_TAG_START: str
|
||||
VARIABLE_TAG_END: str
|
||||
COMMENT_TAG_START: str
|
||||
COMMENT_TAG_END: str
|
||||
TRANSLATOR_COMMENT_MARK: str
|
||||
SINGLE_BRACE_START: str
|
||||
SINGLE_BRACE_END: str
|
||||
UNKNOWN_SOURCE: str
|
||||
tag_re: Any
|
||||
logger: Any
|
||||
|
||||
class TokenType(Enum):
|
||||
TEXT: int = ...
|
||||
VAR: int = ...
|
||||
BLOCK: int = ...
|
||||
COMMENT: int = ...
|
||||
|
||||
class VariableDoesNotExist(Exception):
|
||||
msg: str = ...
|
||||
params: Tuple[Union[Dict[str, str], str]] = ...
|
||||
def __init__(
|
||||
self, msg: str, params: Tuple[Union[Dict[str, str], str]] = ...
|
||||
) -> None: ...
|
||||
|
||||
class Origin:
|
||||
name: str = ...
|
||||
template_name: Optional[Union[bytes, str]] = ...
|
||||
loader: Optional[
|
||||
Union[
|
||||
django.template.backends.dummy.TemplateStrings,
|
||||
django.template.loaders.base.Loader,
|
||||
]
|
||||
] = ...
|
||||
def __init__(
|
||||
self,
|
||||
name: str,
|
||||
template_name: Optional[Union[bytes, str]] = ...,
|
||||
loader: Optional[Union[TemplateStrings, Loader]] = ...,
|
||||
) -> None: ...
|
||||
def __eq__(self, other: Origin) -> bool: ...
|
||||
@property
|
||||
def loader_name(self) -> Optional[str]: ...
|
||||
|
||||
class Template:
|
||||
name: Optional[str] = ...
|
||||
origin: django.template.base.Origin = ...
|
||||
engine: django.template.engine.Engine = ...
|
||||
source: str = ...
|
||||
nodelist: django.template.base.NodeList = ...
|
||||
def __init__(
|
||||
self,
|
||||
template_string: str,
|
||||
origin: Optional[Origin] = ...,
|
||||
name: Optional[str] = ...,
|
||||
engine: Optional[Engine] = ...,
|
||||
) -> None: ...
|
||||
def __iter__(self) -> None: ...
|
||||
def render(self, context: Context) -> Any: ...
|
||||
def compile_nodelist(self) -> NodeList: ...
|
||||
def get_exception_info(
|
||||
self, exception: Exception, token: Token
|
||||
) -> Dict[str, Union[List[Tuple[int, SafeText]], int, str]]: ...
|
||||
|
||||
def linebreak_iter(template_source: str) -> Iterator[int]: ...
|
||||
|
||||
class Token:
|
||||
contents: str
|
||||
token_type: django.template.base.TokenType
|
||||
lineno: Optional[int] = ...
|
||||
position: Optional[Tuple[int, int]] = ...
|
||||
def __init__(
|
||||
self,
|
||||
token_type: TokenType,
|
||||
contents: str,
|
||||
position: Optional[Tuple[int, int]] = ...,
|
||||
lineno: Optional[int] = ...,
|
||||
) -> None: ...
|
||||
def split_contents(self) -> List[str]: ...
|
||||
|
||||
class Lexer:
|
||||
template_string: str = ...
|
||||
verbatim: Union[bool, str] = ...
|
||||
def __init__(self, template_string: str) -> None: ...
|
||||
def tokenize(self) -> List[Token]: ...
|
||||
def create_token(
|
||||
self,
|
||||
token_string: str,
|
||||
position: Optional[Tuple[int, int]],
|
||||
lineno: int,
|
||||
in_tag: bool,
|
||||
) -> Token: ...
|
||||
|
||||
class DebugLexer(Lexer):
|
||||
template_string: str
|
||||
verbatim: Union[bool, str]
|
||||
def tokenize(self) -> List[Token]: ...
|
||||
|
||||
class Parser:
|
||||
tokens: Union[List[django.template.base.Token], str] = ...
|
||||
tags: Dict[str, Callable] = ...
|
||||
filters: Dict[str, Callable] = ...
|
||||
command_stack: List[Tuple[str, django.template.base.Token]] = ...
|
||||
libraries: Dict[str, django.template.library.Library] = ...
|
||||
origin: Optional[django.template.base.Origin] = ...
|
||||
def __init__(
|
||||
self,
|
||||
tokens: Union[List[Token], str],
|
||||
libraries: Optional[Dict[str, Library]] = ...,
|
||||
builtins: Optional[List[Library]] = ...,
|
||||
origin: Optional[Origin] = ...,
|
||||
) -> None: ...
|
||||
def parse(self, parse_until: Optional[Tuple[str]] = ...) -> NodeList: ...
|
||||
def skip_past(self, endtag: str) -> None: ...
|
||||
def extend_nodelist(
|
||||
self, nodelist: NodeList, node: Node, token: Token
|
||||
) -> None: ...
|
||||
def error(self, token: Token, e: Union[Exception, str]) -> Exception: ...
|
||||
def invalid_block_tag(
|
||||
self,
|
||||
token: Token,
|
||||
command: str,
|
||||
parse_until: Union[List[Any], Tuple[str]] = ...,
|
||||
) -> Any: ...
|
||||
def unclosed_block_tag(self, parse_until: Tuple[str]) -> Any: ...
|
||||
def next_token(self) -> Token: ...
|
||||
def prepend_token(self, token: Token) -> None: ...
|
||||
def delete_first_token(self) -> None: ...
|
||||
def add_library(self, lib: Library) -> None: ...
|
||||
def compile_filter(self, token: str) -> FilterExpression: ...
|
||||
def find_filter(self, filter_name: str) -> Callable: ...
|
||||
|
||||
constant_string: Any
|
||||
filter_raw_string: Any
|
||||
filter_re: Any
|
||||
|
||||
class FilterExpression:
|
||||
token: str = ...
|
||||
filters: List[
|
||||
Tuple[
|
||||
Callable,
|
||||
List[
|
||||
Tuple[
|
||||
bool,
|
||||
Union[
|
||||
django.template.base.Variable,
|
||||
django.utils.safestring.SafeText,
|
||||
],
|
||||
]
|
||||
],
|
||||
]
|
||||
] = ...
|
||||
var: Union[
|
||||
django.template.base.Variable, django.utils.safestring.SafeText
|
||||
] = ...
|
||||
def __init__(self, token: str, parser: Parser) -> None: ...
|
||||
def resolve(
|
||||
self,
|
||||
context: Union[Dict[str, Dict[str, str]], Context],
|
||||
ignore_failures: bool = ...,
|
||||
) -> Any: ...
|
||||
def args_check(
|
||||
name: str,
|
||||
func: Callable,
|
||||
provided: List[Tuple[bool, Union[Variable, SafeText]]],
|
||||
) -> bool: ...
|
||||
args_check: Any = ...
|
||||
|
||||
class Variable:
|
||||
var: Union[Dict[Any, Any], str] = ...
|
||||
literal: Optional[Union[django.utils.safestring.SafeText, float]] = ...
|
||||
lookups: Optional[Tuple[str]] = ...
|
||||
translate: bool = ...
|
||||
message_context: Optional[str] = ...
|
||||
def __init__(self, var: Union[Dict[Any, Any], str]) -> None: ...
|
||||
def resolve(
|
||||
self,
|
||||
context: Union[
|
||||
Dict[str, Dict[str, Union[int, str]]], Context, int, str
|
||||
],
|
||||
) -> Any: ...
|
||||
|
||||
class Node:
|
||||
must_be_first: bool = ...
|
||||
child_nodelists: Any = ...
|
||||
token: Any = ...
|
||||
def render(self, context: Any) -> None: ...
|
||||
def render_annotated(self, context: Context) -> Union[int, str]: ...
|
||||
def __iter__(self) -> None: ...
|
||||
def get_nodes_by_type(self, nodetype: Type[Node]) -> List[Node]: ...
|
||||
|
||||
class NodeList(list):
|
||||
contains_nontext: bool = ...
|
||||
def render(self, context: Context) -> SafeText: ...
|
||||
def get_nodes_by_type(self, nodetype: Type[Node]) -> List[Node]: ...
|
||||
|
||||
class TextNode(Node):
|
||||
origin: django.template.base.Origin
|
||||
token: django.template.base.Token
|
||||
s: str = ...
|
||||
def __init__(self, s: str) -> None: ...
|
||||
def render(self, context: Context) -> str: ...
|
||||
|
||||
def render_value_in_context(value: Any, context: Context) -> str: ...
|
||||
|
||||
class VariableNode(Node):
|
||||
origin: django.template.base.Origin
|
||||
token: django.template.base.Token
|
||||
filter_expression: django.template.base.FilterExpression = ...
|
||||
def __init__(self, filter_expression: FilterExpression) -> None: ...
|
||||
def render(self, context: Context) -> str: ...
|
||||
|
||||
kwarg_re: Any
|
||||
|
||||
def token_kwargs(
|
||||
bits: List[str], parser: Parser, support_legacy: bool = ...
|
||||
) -> Dict[str, FilterExpression]: ...
|
||||
156
django-stubs-generated/template/context.pyi
Normal file
156
django-stubs-generated/template/context.pyi
Normal file
@@ -0,0 +1,156 @@
|
||||
from itertools import cycle
|
||||
from typing import Any, Callable, Dict, Iterator, List, Optional, Type, Union
|
||||
|
||||
from django.contrib.admin.templatetags.admin_list import ResultList
|
||||
from django.contrib.admin.views.main import ChangeList
|
||||
from django.db.models.base import Model
|
||||
from django.db.models.options import Options
|
||||
from django.forms.boundfield import BoundField
|
||||
from django.http.request import HttpRequest
|
||||
from django.template.base import Node, Origin, Template
|
||||
from django.template.defaulttags import CycleNode, IfChangedNode
|
||||
from django.template.library import InclusionNode
|
||||
from django.template.loader_tags import BlockContext
|
||||
|
||||
|
||||
class ContextPopException(Exception): ...
|
||||
|
||||
class ContextDict(dict):
|
||||
context: django.template.context.BaseContext = ...
|
||||
def __init__(
|
||||
self, context: BaseContext, *args: Any, **kwargs: Any
|
||||
) -> None: ...
|
||||
def __enter__(self) -> ContextDict: ...
|
||||
def __exit__(self, *args: Any, **kwargs: Any) -> None: ...
|
||||
|
||||
class BaseContext:
|
||||
def __init__(self, dict_: Any = ...) -> None: ...
|
||||
def __copy__(self) -> BaseContext: ...
|
||||
def __iter__(self) -> None: ...
|
||||
def push(self, *args: Any, **kwargs: Any) -> ContextDict: ...
|
||||
def pop(self) -> ContextDict: ...
|
||||
def __setitem__(self, key: Union[Node, str], value: Any) -> None: ...
|
||||
def set_upward(self, key: str, value: Union[int, str]) -> None: ...
|
||||
def __getitem__(self, key: Union[int, str]) -> Any: ...
|
||||
def __delitem__(self, key: Any) -> None: ...
|
||||
def __contains__(self, key: str) -> bool: ...
|
||||
def get(
|
||||
self, key: str, otherwise: Optional[int] = ...
|
||||
) -> Optional[Union[Options, int, str]]: ...
|
||||
def setdefault(
|
||||
self,
|
||||
key: Union[IfChangedNode, str],
|
||||
default: Optional[Union[List[Origin], int]] = ...,
|
||||
) -> Optional[Union[List[Origin], int]]: ...
|
||||
def new(
|
||||
self,
|
||||
values: Optional[
|
||||
Union[
|
||||
Dict[
|
||||
str,
|
||||
Union[
|
||||
List[Dict[str, Union[int, str]]],
|
||||
List[ResultList],
|
||||
List[BoundField],
|
||||
ChangeList,
|
||||
int,
|
||||
],
|
||||
],
|
||||
Dict[str, Union[List[Dict[str, str]], ChangeList, int, str]],
|
||||
Dict[str, Union[ChangeList, int, range, str]],
|
||||
Context,
|
||||
]
|
||||
] = ...,
|
||||
) -> Context: ...
|
||||
def flatten(
|
||||
self
|
||||
) -> Dict[
|
||||
str, Optional[Union[Dict[str, Union[Type[Any], str]], int, str]]
|
||||
]: ...
|
||||
def __eq__(self, other: Context) -> bool: ...
|
||||
|
||||
class Context(BaseContext):
|
||||
dicts: Any
|
||||
autoescape: bool = ...
|
||||
use_l10n: Optional[bool] = ...
|
||||
use_tz: Optional[bool] = ...
|
||||
template_name: Optional[str] = ...
|
||||
render_context: django.template.context.RenderContext = ...
|
||||
template: Optional[django.template.base.Template] = ...
|
||||
def __init__(
|
||||
self,
|
||||
dict_: Any = ...,
|
||||
autoescape: bool = ...,
|
||||
use_l10n: Optional[bool] = ...,
|
||||
use_tz: None = ...,
|
||||
) -> None: ...
|
||||
def bind_template(self, template: Template) -> Iterator[None]: ...
|
||||
def __copy__(self) -> Context: ...
|
||||
def update(
|
||||
self,
|
||||
other_dict: Union[
|
||||
Dict[str, Model], Dict[str, int], Dict[str, str], Context
|
||||
],
|
||||
) -> ContextDict: ...
|
||||
|
||||
class RenderContext(BaseContext):
|
||||
dicts: List[Dict[Union[django.template.loader_tags.IncludeNode, str], str]]
|
||||
template: Optional[django.template.base.Template] = ...
|
||||
def __iter__(self) -> None: ...
|
||||
def __contains__(self, key: Union[CycleNode, str]) -> bool: ...
|
||||
def get(
|
||||
self, key: Union[InclusionNode, str], otherwise: None = ...
|
||||
) -> Optional[Union[Template, BlockContext]]: ...
|
||||
def __getitem__(
|
||||
self, key: Union[Node, str]
|
||||
) -> Optional[Union[List[Origin], BlockContext, cycle]]: ...
|
||||
def push_state(
|
||||
self, template: Template, isolated_context: bool = ...
|
||||
) -> Iterator[None]: ...
|
||||
|
||||
class RequestContext(Context):
|
||||
autoescape: bool
|
||||
dicts: List[Dict[str, str]]
|
||||
render_context: django.template.context.RenderContext
|
||||
template_name: Optional[str]
|
||||
use_l10n: None
|
||||
use_tz: None
|
||||
request: django.http.request.HttpRequest = ...
|
||||
def __init__(
|
||||
self,
|
||||
request: HttpRequest,
|
||||
dict_: Optional[
|
||||
Dict[str, Union[Dict[str, Union[Type[Any], str]], str]]
|
||||
] = ...,
|
||||
processors: Optional[List[Callable]] = ...,
|
||||
use_l10n: None = ...,
|
||||
use_tz: None = ...,
|
||||
autoescape: bool = ...,
|
||||
) -> None: ...
|
||||
template: Optional[django.template.base.Template] = ...
|
||||
def bind_template(self, template: Template) -> Iterator[None]: ...
|
||||
def new(
|
||||
self,
|
||||
values: Optional[
|
||||
Union[
|
||||
Dict[str, Union[Dict[str, str], List[Dict[str, str]], bool]],
|
||||
Dict[str, Union[List[Any], ChangeList, int, str]],
|
||||
Dict[
|
||||
str,
|
||||
Union[
|
||||
List[Dict[str, Optional[Union[int, str]]]],
|
||||
List[ResultList],
|
||||
List[BoundField],
|
||||
ChangeList,
|
||||
int,
|
||||
],
|
||||
],
|
||||
Dict[str, Union[ChangeList, int, range, str]],
|
||||
Context,
|
||||
]
|
||||
] = ...,
|
||||
) -> RequestContext: ...
|
||||
|
||||
def make_context(
|
||||
context: Any, request: Optional[HttpRequest] = ..., **kwargs: Any
|
||||
) -> Context: ...
|
||||
16
django-stubs-generated/template/context_processors.pyi
Normal file
16
django-stubs-generated/template/context_processors.pyi
Normal file
@@ -0,0 +1,16 @@
|
||||
from typing import Any, Callable, Dict, List, Tuple, Union
|
||||
|
||||
from django.core.handlers.wsgi import WSGIRequest
|
||||
from django.http.request import HttpRequest
|
||||
from django.utils.functional import SimpleLazyObject
|
||||
|
||||
|
||||
def csrf(request: HttpRequest) -> Dict[str, SimpleLazyObject]: ...
|
||||
def debug(request: HttpRequest) -> Dict[str, Union[Callable, bool]]: ...
|
||||
def i18n(
|
||||
request: WSGIRequest
|
||||
) -> Dict[str, Union[List[Tuple[str, str]], bool, str]]: ...
|
||||
def tz(request: HttpRequest) -> Dict[str, str]: ...
|
||||
def static(request: HttpRequest) -> Dict[str, str]: ...
|
||||
def media(request: Any): ...
|
||||
def request(request: HttpRequest) -> Dict[str, HttpRequest]: ...
|
||||
125
django-stubs-generated/template/defaultfilters.pyi
Normal file
125
django-stubs-generated/template/defaultfilters.pyi
Normal file
@@ -0,0 +1,125 @@
|
||||
from datetime import date, datetime, timedelta
|
||||
from decimal import Decimal
|
||||
from typing import Any, Callable, Dict, Iterator, List, Optional, Tuple, Union
|
||||
|
||||
from django.utils.safestring import SafeText
|
||||
|
||||
from .base import Variable as Variable, VariableDoesNotExist as VariableDoesNotExist
|
||||
from .library import Library as Library
|
||||
|
||||
register: Any
|
||||
|
||||
def stringfilter(func: Callable) -> Callable: ...
|
||||
def addslashes(value: str) -> str: ...
|
||||
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, str]], arg: Union[int, str] = ...
|
||||
) -> str: ...
|
||||
def iriencode(value: str) -> str: ...
|
||||
def linenumbers(value: str, autoescape: bool = ...) -> SafeText: ...
|
||||
def lower(value: str) -> str: ...
|
||||
def make_list(value: str) -> List[str]: ...
|
||||
def slugify(value: str) -> SafeText: ...
|
||||
def stringformat(value: Any, arg: str) -> str: ...
|
||||
def title(value: str) -> str: ...
|
||||
def truncatechars(value: str, arg: Union[SafeText, int]) -> str: ...
|
||||
def truncatechars_html(value: str, arg: Union[int, str]) -> str: ...
|
||||
def truncatewords(value: str, arg: Union[int, str]) -> str: ...
|
||||
def truncatewords_html(value: str, arg: Union[int, str]) -> str: ...
|
||||
def upper(value: str) -> str: ...
|
||||
def urlencode(value: str, safe: Optional[SafeText] = ...) -> str: ...
|
||||
def urlize(value: str, autoescape: bool = ...) -> SafeText: ...
|
||||
def urlizetrunc(
|
||||
value: str, limit: Union[SafeText, int], autoescape: bool = ...
|
||||
) -> SafeText: ...
|
||||
def wordcount(value: str) -> int: ...
|
||||
def wordwrap(value: str, arg: Union[SafeText, int]) -> str: ...
|
||||
def ljust(value: str, arg: Union[SafeText, int]) -> str: ...
|
||||
def rjust(value: str, arg: Union[SafeText, int]) -> str: ...
|
||||
def center(value: str, arg: Union[SafeText, int]) -> str: ...
|
||||
def cut(value: str, arg: str) -> str: ...
|
||||
def escape_filter(value: str) -> SafeText: ...
|
||||
def force_escape(value: str) -> SafeText: ...
|
||||
def linebreaks_filter(value: str, autoescape: bool = ...) -> SafeText: ...
|
||||
def linebreaksbr(value: str, autoescape: bool = ...) -> SafeText: ...
|
||||
def safe(value: str) -> SafeText: ...
|
||||
def safeseq(value: List[str]) -> List[SafeText]: ...
|
||||
def striptags(value: str) -> str: ...
|
||||
def dictsort(
|
||||
value: Union[
|
||||
Dict[str, int],
|
||||
List[Dict[str, Dict[str, Union[int, str]]]],
|
||||
List[Dict[str, str]],
|
||||
List[Tuple[str, str]],
|
||||
List[int],
|
||||
int,
|
||||
str,
|
||||
],
|
||||
arg: Union[int, str],
|
||||
) -> Union[
|
||||
List[Dict[str, Dict[str, Union[int, str]]]],
|
||||
List[Dict[str, str]],
|
||||
List[Tuple[str, str]],
|
||||
str,
|
||||
]: ...
|
||||
def dictsortreversed(
|
||||
value: Union[
|
||||
Dict[str, int],
|
||||
List[Dict[str, Union[int, str]]],
|
||||
List[Tuple[str, str]],
|
||||
List[int],
|
||||
int,
|
||||
str,
|
||||
],
|
||||
arg: Union[int, str],
|
||||
) -> Union[List[Dict[str, Union[int, str]]], List[Tuple[str, str]], str]: ...
|
||||
def first(value: Union[List[int], List[str], str]) -> Union[int, str]: ...
|
||||
def join(value: Any, arg: str, autoescape: bool = ...) -> Any: ...
|
||||
def last(value: List[str]) -> str: ...
|
||||
def length(value: Any) -> int: ...
|
||||
def length_is(
|
||||
value: Optional[Union[List[Callable], Tuple[str, str], int, str]],
|
||||
arg: Union[SafeText, int],
|
||||
) -> Union[bool, str]: ...
|
||||
def random(value: List[str]) -> str: ...
|
||||
def slice_filter(value: Any, arg: str) -> Any: ...
|
||||
def unordered_list(
|
||||
value: Union[
|
||||
Iterator[Any],
|
||||
List[Union[List[Union[List[Union[List[str], str]], str]], str]],
|
||||
],
|
||||
autoescape: bool = ...,
|
||||
) -> SafeText: ...
|
||||
def add(
|
||||
value: Union[List[int], Tuple[int, int], date, int, str],
|
||||
arg: Union[List[int], Tuple[int, int], timedelta, int, str],
|
||||
) -> Union[List[int], Tuple[int, int, int, int], date, int, str]: ...
|
||||
def get_digit(value: Union[int, str], arg: int) -> Union[int, str]: ...
|
||||
def date(
|
||||
value: Optional[Union[datetime, str]], arg: Optional[str] = ...
|
||||
) -> str: ...
|
||||
def time(
|
||||
value: Optional[Union[datetime, str]], arg: Optional[str] = ...
|
||||
) -> str: ...
|
||||
def timesince_filter(
|
||||
value: Optional[date], arg: Optional[date] = ...
|
||||
) -> str: ...
|
||||
def timeuntil_filter(
|
||||
value: Optional[date], arg: Optional[date] = ...
|
||||
) -> str: ...
|
||||
def default(
|
||||
value: Optional[Union[int, str]], arg: Union[int, str]
|
||||
) -> Union[int, str]: ...
|
||||
def default_if_none(
|
||||
value: Optional[str], arg: Union[int, str]
|
||||
) -> Union[int, str]: ...
|
||||
def divisibleby(value: int, arg: int) -> bool: ...
|
||||
def yesno(
|
||||
value: Optional[int], arg: Optional[str] = ...
|
||||
) -> Optional[Union[bool, str]]: ...
|
||||
def filesizeformat(bytes_: Union[complex, int, str]) -> str: ...
|
||||
def pluralize(value: Any, arg: str = ...) -> str: ...
|
||||
def phone2numeric_filter(value: str) -> str: ...
|
||||
def pprint(value: Any) -> str: ...
|
||||
313
django-stubs-generated/template/defaulttags.pyi
Normal file
313
django-stubs-generated/template/defaulttags.pyi
Normal file
@@ -0,0 +1,313 @@
|
||||
from collections import namedtuple
|
||||
from datetime import date
|
||||
from typing import Any, Dict, List, Optional, Tuple, Union
|
||||
|
||||
from django.template.base import FilterExpression, NodeList, Parser, Token
|
||||
from django.template.context import Context, RequestContext
|
||||
from django.template.library import Library
|
||||
from django.utils.safestring import SafeText
|
||||
|
||||
from .base import (BLOCK_TAG_END, BLOCK_TAG_START, COMMENT_TAG_END,
|
||||
COMMENT_TAG_START, FILTER_SEPARATOR, SINGLE_BRACE_END,
|
||||
SINGLE_BRACE_START, VARIABLE_ATTRIBUTE_SEPARATOR,
|
||||
VARIABLE_TAG_END, VARIABLE_TAG_START, Context, Node,
|
||||
NodeList, TemplateSyntaxError, VariableDoesNotExist,
|
||||
kwarg_re, render_value_in_context, token_kwargs)
|
||||
from .defaultfilters import date
|
||||
from .library import Library
|
||||
from .smartif import IfParser, Literal
|
||||
|
||||
register: Any
|
||||
|
||||
class AutoEscapeControlNode(Node):
|
||||
nodelist: django.template.base.NodeList
|
||||
origin: django.template.base.Origin
|
||||
setting: bool
|
||||
token: django.template.base.Token
|
||||
def __init__(self, setting: bool, nodelist: NodeList) -> None: ...
|
||||
def render(self, context: Context) -> SafeText: ...
|
||||
|
||||
class CommentNode(Node):
|
||||
origin: django.template.base.Origin
|
||||
token: django.template.base.Token
|
||||
def render(self, context: Context) -> str: ...
|
||||
|
||||
class CsrfTokenNode(Node):
|
||||
origin: django.template.base.Origin
|
||||
token: django.template.base.Token
|
||||
def render(self, context: RequestContext) -> SafeText: ...
|
||||
|
||||
class CycleNode(Node):
|
||||
origin: django.template.base.Origin
|
||||
token: django.template.base.Token
|
||||
cyclevars: List[django.template.base.FilterExpression] = ...
|
||||
variable_name: Optional[str] = ...
|
||||
silent: bool = ...
|
||||
def __init__(
|
||||
self,
|
||||
cyclevars: List[FilterExpression],
|
||||
variable_name: Optional[str] = ...,
|
||||
silent: bool = ...,
|
||||
) -> None: ...
|
||||
def render(self, context: Context) -> str: ...
|
||||
def reset(self, context: Context) -> None: ...
|
||||
|
||||
class DebugNode(Node):
|
||||
origin: django.template.base.Origin
|
||||
token: django.template.base.Token
|
||||
def render(self, context: Context) -> str: ...
|
||||
|
||||
class FilterNode(Node):
|
||||
filter_expr: django.template.base.FilterExpression
|
||||
nodelist: django.template.base.NodeList
|
||||
origin: django.template.base.Origin
|
||||
token: django.template.base.Token
|
||||
def __init__(
|
||||
self, filter_expr: FilterExpression, nodelist: NodeList
|
||||
) -> None: ...
|
||||
def render(self, context: Context) -> Any: ...
|
||||
|
||||
class FirstOfNode(Node):
|
||||
origin: django.template.base.Origin
|
||||
token: django.template.base.Token
|
||||
vars: List[django.template.base.FilterExpression] = ...
|
||||
asvar: Optional[str] = ...
|
||||
def __init__(
|
||||
self, variables: List[FilterExpression], asvar: Optional[str] = ...
|
||||
) -> None: ...
|
||||
def render(self, context: Context) -> str: ...
|
||||
|
||||
class ForNode(Node):
|
||||
loopvars: Union[List[str], str]
|
||||
origin: django.template.base.Origin
|
||||
sequence: Union[django.template.base.FilterExpression, str]
|
||||
token: django.template.base.Token
|
||||
child_nodelists: Any = ...
|
||||
is_reversed: bool = ...
|
||||
nodelist_loop: Union[List[str], django.template.base.NodeList] = ...
|
||||
nodelist_empty: Union[List[str], django.template.base.NodeList] = ...
|
||||
def __init__(
|
||||
self,
|
||||
loopvars: Union[List[str], str],
|
||||
sequence: Union[FilterExpression, str],
|
||||
is_reversed: bool,
|
||||
nodelist_loop: Union[List[str], NodeList],
|
||||
nodelist_empty: Optional[Union[List[str], NodeList]] = ...,
|
||||
) -> None: ...
|
||||
def render(self, context: Context) -> SafeText: ...
|
||||
|
||||
class IfChangedNode(Node):
|
||||
nodelist_false: django.template.base.NodeList
|
||||
nodelist_true: django.template.base.NodeList
|
||||
origin: django.template.base.Origin
|
||||
token: django.template.base.Token
|
||||
child_nodelists: Any = ...
|
||||
def __init__(
|
||||
self, nodelist_true: NodeList, nodelist_false: NodeList, *varlist: Any
|
||||
) -> None: ...
|
||||
def render(self, context: Context) -> str: ...
|
||||
|
||||
class IfEqualNode(Node):
|
||||
nodelist_false: Union[List[Any], django.template.base.NodeList]
|
||||
nodelist_true: Union[List[Any], django.template.base.NodeList]
|
||||
origin: django.template.base.Origin
|
||||
token: django.template.base.Token
|
||||
var1: Union[django.template.base.FilterExpression, str]
|
||||
var2: Union[django.template.base.FilterExpression, str]
|
||||
child_nodelists: Any = ...
|
||||
negate: bool = ...
|
||||
def __init__(
|
||||
self,
|
||||
var1: Union[FilterExpression, str],
|
||||
var2: Union[FilterExpression, str],
|
||||
nodelist_true: Union[List[Any], NodeList],
|
||||
nodelist_false: Union[List[Any], NodeList],
|
||||
negate: bool,
|
||||
) -> None: ...
|
||||
def render(self, context: Context) -> SafeText: ...
|
||||
|
||||
class IfNode(Node):
|
||||
origin: django.template.base.Origin
|
||||
token: django.template.base.Token
|
||||
conditions_nodelists: List[
|
||||
Tuple[
|
||||
Optional[django.template.defaulttags.TemplateLiteral],
|
||||
django.template.base.NodeList,
|
||||
]
|
||||
] = ...
|
||||
def __init__(
|
||||
self,
|
||||
conditions_nodelists: List[Tuple[Optional[TemplateLiteral], NodeList]],
|
||||
) -> None: ...
|
||||
def __iter__(self) -> None: ...
|
||||
@property
|
||||
def nodelist(self) -> NodeList: ...
|
||||
def render(self, context: Context) -> str: ...
|
||||
|
||||
class LoremNode(Node):
|
||||
common: bool
|
||||
count: django.template.base.FilterExpression
|
||||
method: str
|
||||
origin: django.template.base.Origin
|
||||
token: django.template.base.Token
|
||||
def __init__(
|
||||
self, count: FilterExpression, method: str, common: bool
|
||||
) -> None: ...
|
||||
def render(self, context: Context) -> str: ...
|
||||
|
||||
GroupedResult = namedtuple("GroupedResult", ["grouper", "list"])
|
||||
|
||||
class RegroupNode(Node):
|
||||
expression: django.template.base.FilterExpression
|
||||
origin: django.template.base.Origin
|
||||
target: django.template.base.FilterExpression
|
||||
token: django.template.base.Token
|
||||
var_name: str = ...
|
||||
def __init__(
|
||||
self,
|
||||
target: FilterExpression,
|
||||
expression: FilterExpression,
|
||||
var_name: str,
|
||||
) -> None: ...
|
||||
def resolve_expression(
|
||||
self, obj: Dict[str, date], context: Context
|
||||
) -> Union[int, str]: ...
|
||||
def render(self, context: Context) -> str: ...
|
||||
|
||||
class LoadNode(Node):
|
||||
origin: django.template.base.Origin
|
||||
token: django.template.base.Token
|
||||
def render(self, context: Context) -> str: ...
|
||||
|
||||
class NowNode(Node):
|
||||
origin: django.template.base.Origin
|
||||
token: django.template.base.Token
|
||||
format_string: str = ...
|
||||
asvar: Optional[str] = ...
|
||||
def __init__(
|
||||
self, format_string: str, asvar: Optional[str] = ...
|
||||
) -> None: ...
|
||||
def render(self, context: Context) -> str: ...
|
||||
|
||||
class ResetCycleNode(Node):
|
||||
origin: django.template.base.Origin
|
||||
token: django.template.base.Token
|
||||
node: django.template.defaulttags.CycleNode = ...
|
||||
def __init__(self, node: CycleNode) -> None: ...
|
||||
def render(self, context: Context) -> str: ...
|
||||
|
||||
class SpacelessNode(Node):
|
||||
origin: django.template.base.Origin
|
||||
token: django.template.base.Token
|
||||
nodelist: django.template.base.NodeList = ...
|
||||
def __init__(self, nodelist: NodeList) -> None: ...
|
||||
def render(self, context: Context) -> str: ...
|
||||
|
||||
class TemplateTagNode(Node):
|
||||
origin: django.template.base.Origin
|
||||
token: django.template.base.Token
|
||||
mapping: Any = ...
|
||||
tagtype: str = ...
|
||||
def __init__(self, tagtype: str) -> None: ...
|
||||
def render(self, context: Context) -> str: ...
|
||||
|
||||
class URLNode(Node):
|
||||
origin: django.template.base.Origin
|
||||
token: django.template.base.Token
|
||||
view_name: django.template.base.FilterExpression = ...
|
||||
args: List[django.template.base.FilterExpression] = ...
|
||||
kwargs: Dict[str, django.template.base.FilterExpression] = ...
|
||||
asvar: Optional[str] = ...
|
||||
def __init__(
|
||||
self,
|
||||
view_name: FilterExpression,
|
||||
args: List[FilterExpression],
|
||||
kwargs: Dict[str, FilterExpression],
|
||||
asvar: Optional[str],
|
||||
) -> None: ...
|
||||
def render(self, context: Context) -> str: ...
|
||||
|
||||
class VerbatimNode(Node):
|
||||
origin: django.template.base.Origin
|
||||
token: django.template.base.Token
|
||||
content: django.utils.safestring.SafeText = ...
|
||||
def __init__(self, content: SafeText) -> None: ...
|
||||
def render(self, context: Context) -> SafeText: ...
|
||||
|
||||
class WidthRatioNode(Node):
|
||||
origin: django.template.base.Origin
|
||||
token: django.template.base.Token
|
||||
val_expr: django.template.base.FilterExpression = ...
|
||||
max_expr: django.template.base.FilterExpression = ...
|
||||
max_width: django.template.base.FilterExpression = ...
|
||||
asvar: Optional[str] = ...
|
||||
def __init__(
|
||||
self,
|
||||
val_expr: FilterExpression,
|
||||
max_expr: FilterExpression,
|
||||
max_width: FilterExpression,
|
||||
asvar: Optional[str] = ...,
|
||||
) -> None: ...
|
||||
def render(self, context: Context) -> str: ...
|
||||
|
||||
class WithNode(Node):
|
||||
origin: django.template.base.Origin
|
||||
token: django.template.base.Token
|
||||
nodelist: Union[List[Any], django.template.base.NodeList] = ...
|
||||
extra_context: Dict[
|
||||
str, Union[django.template.base.FilterExpression, str]
|
||||
] = ...
|
||||
def __init__(
|
||||
self,
|
||||
var: Optional[str],
|
||||
name: Optional[str],
|
||||
nodelist: Union[List[Any], NodeList],
|
||||
extra_context: Optional[Dict[str, FilterExpression]] = ...,
|
||||
) -> None: ...
|
||||
def render(self, context: Context) -> Any: ...
|
||||
|
||||
def autoescape(parser: Parser, token: Token) -> AutoEscapeControlNode: ...
|
||||
def comment(parser: Parser, token: Token) -> CommentNode: ...
|
||||
def cycle(parser: Parser, token: Token) -> CycleNode: ...
|
||||
def csrf_token(parser: Parser, token: Token) -> CsrfTokenNode: ...
|
||||
def debug(parser: Parser, token: Token) -> DebugNode: ...
|
||||
def do_filter(parser: Parser, token: Token) -> FilterNode: ...
|
||||
def firstof(parser: Parser, token: Token) -> FirstOfNode: ...
|
||||
def do_for(parser: Parser, token: Token) -> ForNode: ...
|
||||
def do_ifequal(parser: Parser, token: Token, negate: bool) -> IfEqualNode: ...
|
||||
def ifequal(parser: Parser, token: Token) -> IfEqualNode: ...
|
||||
def ifnotequal(parser: Parser, token: Token) -> IfEqualNode: ...
|
||||
|
||||
class TemplateLiteral(Literal):
|
||||
value: django.template.base.FilterExpression = ...
|
||||
text: str = ...
|
||||
def __init__(self, value: FilterExpression, text: str) -> None: ...
|
||||
def display(self) -> str: ...
|
||||
def eval(self, context: Context) -> Any: ...
|
||||
|
||||
class TemplateIfParser(IfParser):
|
||||
current_token: django.template.defaulttags.TemplateLiteral
|
||||
pos: int
|
||||
tokens: List[django.template.defaulttags.TemplateLiteral]
|
||||
error_class: Any = ...
|
||||
template_parser: django.template.base.Parser = ...
|
||||
def __init__(self, parser: Parser, *args: Any, **kwargs: Any) -> None: ...
|
||||
def create_var(self, value: str) -> TemplateLiteral: ...
|
||||
|
||||
def do_if(parser: Parser, token: Token) -> IfNode: ...
|
||||
def ifchanged(parser: Parser, token: Token) -> IfChangedNode: ...
|
||||
def find_library(parser: Parser, name: str) -> Library: ...
|
||||
def load_from_library(
|
||||
library: Library, label: str, names: List[str]
|
||||
) -> Library: ...
|
||||
def load(parser: Parser, token: Token) -> LoadNode: ...
|
||||
def lorem(parser: Parser, token: Token) -> LoremNode: ...
|
||||
def now(parser: Parser, token: Token) -> NowNode: ...
|
||||
def regroup(parser: Parser, token: Token) -> RegroupNode: ...
|
||||
def resetcycle(parser: Parser, token: Token) -> ResetCycleNode: ...
|
||||
def spaceless(parser: Parser, token: Token) -> SpacelessNode: ...
|
||||
def templatetag(parser: Parser, token: Token) -> TemplateTagNode: ...
|
||||
def url(parser: Parser, token: Token) -> URLNode: ...
|
||||
def verbatim(parser: Parser, token: Token) -> VerbatimNode: ...
|
||||
def widthratio(parser: Parser, token: Token) -> WidthRatioNode: ...
|
||||
def do_with(parser: Parser, token: Token) -> WithNode: ...
|
||||
83
django-stubs-generated/template/engine.pyi
Normal file
83
django-stubs-generated/template/engine.pyi
Normal file
@@ -0,0 +1,83 @@
|
||||
from typing import Any, Callable, Dict, List, Optional, Tuple, Union
|
||||
|
||||
from django.template.base import Origin, Template
|
||||
from django.template.library import Library
|
||||
from django.template.loaders.base import Loader
|
||||
from django.utils.safestring import SafeText
|
||||
|
||||
from .base import Context, Template
|
||||
from .context import _builtin_context_processors
|
||||
from .exceptions import TemplateDoesNotExist
|
||||
from .library import import_library
|
||||
|
||||
|
||||
class Engine:
|
||||
template_context_processors: Tuple[Callable]
|
||||
template_loaders: List[django.template.loaders.base.Loader]
|
||||
default_builtins: Any = ...
|
||||
dirs: List[str] = ...
|
||||
app_dirs: bool = ...
|
||||
autoescape: bool = ...
|
||||
context_processors: Union[List[str], Tuple[str]] = ...
|
||||
debug: bool = ...
|
||||
loaders: Union[
|
||||
List[List[Union[Dict[str, str], str]]],
|
||||
List[Tuple[str, List[str]]],
|
||||
List[str],
|
||||
] = ...
|
||||
string_if_invalid: str = ...
|
||||
file_charset: str = ...
|
||||
libraries: Dict[str, str] = ...
|
||||
template_libraries: Dict[str, django.template.library.Library] = ...
|
||||
builtins: List[str] = ...
|
||||
template_builtins: List[django.template.library.Library] = ...
|
||||
def __init__(
|
||||
self,
|
||||
dirs: Optional[List[str]] = ...,
|
||||
app_dirs: bool = ...,
|
||||
context_processors: Optional[Union[List[str], Tuple[str]]] = ...,
|
||||
debug: bool = ...,
|
||||
loaders: Optional[
|
||||
Union[
|
||||
List[List[Union[Dict[str, str], str]]],
|
||||
List[Tuple[str, List[str]]],
|
||||
List[str],
|
||||
]
|
||||
] = ...,
|
||||
string_if_invalid: str = ...,
|
||||
file_charset: str = ...,
|
||||
libraries: Optional[Dict[str, str]] = ...,
|
||||
builtins: Optional[List[str]] = ...,
|
||||
autoescape: bool = ...,
|
||||
) -> None: ...
|
||||
@staticmethod
|
||||
def get_default() -> Engine: ...
|
||||
def template_context_processors(self) -> Tuple[Callable]: ...
|
||||
def get_template_builtins(self, builtins: List[str]) -> List[Library]: ...
|
||||
def get_template_libraries(
|
||||
self, libraries: Dict[str, str]
|
||||
) -> Dict[str, Library]: ...
|
||||
def template_loaders(self) -> List[Loader]: ...
|
||||
def get_template_loaders(
|
||||
self,
|
||||
template_loaders: Union[
|
||||
List[List[Union[Dict[str, str], str]]],
|
||||
List[Tuple[str, List[str]]],
|
||||
List[str],
|
||||
],
|
||||
) -> List[Loader]: ...
|
||||
def find_template_loader(
|
||||
self,
|
||||
loader: Union[
|
||||
List[Union[Dict[str, str], str]], Tuple[str, List[str]], str
|
||||
],
|
||||
) -> Loader: ...
|
||||
def find_template(
|
||||
self, name: str, dirs: None = ..., skip: Optional[List[Origin]] = ...
|
||||
) -> Tuple[Template, Origin]: ...
|
||||
def from_string(self, template_code: str) -> Template: ...
|
||||
def get_template(self, template_name: str) -> Template: ...
|
||||
def render_to_string(
|
||||
self, template_name: str, context: Any = ...
|
||||
) -> SafeText: ...
|
||||
def select_template(self, template_name_list: List[str]) -> Template: ...
|
||||
19
django-stubs-generated/template/exceptions.pyi
Normal file
19
django-stubs-generated/template/exceptions.pyi
Normal file
@@ -0,0 +1,19 @@
|
||||
from typing import Any, List, Optional, Tuple, Union
|
||||
|
||||
from django.template.backends.base import BaseEngine
|
||||
from django.template.base import Origin
|
||||
|
||||
|
||||
class TemplateDoesNotExist(Exception):
|
||||
backend: Optional[django.template.backends.base.BaseEngine] = ...
|
||||
tried: List[Tuple[django.template.base.Origin, str]] = ...
|
||||
chain: List[django.template.exceptions.TemplateDoesNotExist] = ...
|
||||
def __init__(
|
||||
self,
|
||||
msg: Union[Origin, str],
|
||||
tried: Optional[List[Tuple[Origin, str]]] = ...,
|
||||
backend: Optional[BaseEngine] = ...,
|
||||
chain: Optional[List[TemplateDoesNotExist]] = ...,
|
||||
) -> None: ...
|
||||
|
||||
class TemplateSyntaxError(Exception): ...
|
||||
108
django-stubs-generated/template/library.pyi
Normal file
108
django-stubs-generated/template/library.pyi
Normal file
@@ -0,0 +1,108 @@
|
||||
from typing import Any, Callable, Dict, List, Optional, Tuple, Union
|
||||
|
||||
from django.template.base import FilterExpression, Parser, Template
|
||||
from django.template.context import Context
|
||||
from django.utils.safestring import SafeText
|
||||
|
||||
from .base import Node, Template
|
||||
from .exceptions import TemplateSyntaxError as TemplateSyntaxError
|
||||
|
||||
|
||||
class InvalidTemplateLibrary(Exception): ...
|
||||
|
||||
class Library:
|
||||
filters: Dict[str, Callable] = ...
|
||||
tags: Dict[str, Callable] = ...
|
||||
def __init__(self) -> None: ...
|
||||
def tag(
|
||||
self,
|
||||
name: Optional[Union[Callable, str]] = ...,
|
||||
compile_function: Optional[Union[Callable, str]] = ...,
|
||||
) -> Callable: ...
|
||||
def tag_function(self, func: Callable) -> Callable: ...
|
||||
def filter(
|
||||
self,
|
||||
name: Optional[Union[Callable, str]] = ...,
|
||||
filter_func: Optional[Union[Callable, str]] = ...,
|
||||
**flags: Any
|
||||
) -> Callable: ...
|
||||
def filter_function(self, func: Callable, **flags: Any) -> Callable: ...
|
||||
def simple_tag(
|
||||
self,
|
||||
func: Optional[Union[Callable, str]] = ...,
|
||||
takes_context: Optional[bool] = ...,
|
||||
name: Optional[str] = ...,
|
||||
) -> Callable: ...
|
||||
def inclusion_tag(
|
||||
self,
|
||||
filename: Union[Template, str],
|
||||
func: None = ...,
|
||||
takes_context: Optional[bool] = ...,
|
||||
name: Optional[str] = ...,
|
||||
) -> Callable: ...
|
||||
|
||||
class TagHelperNode(Node):
|
||||
func: Any = ...
|
||||
takes_context: Any = ...
|
||||
args: Any = ...
|
||||
kwargs: Any = ...
|
||||
def __init__(
|
||||
self,
|
||||
func: Callable,
|
||||
takes_context: Optional[bool],
|
||||
args: List[FilterExpression],
|
||||
kwargs: Dict[str, FilterExpression],
|
||||
) -> None: ...
|
||||
def get_resolved_arguments(
|
||||
self, context: Context
|
||||
) -> Tuple[List[int], Dict[str, Union[SafeText, int]]]: ...
|
||||
|
||||
class SimpleNode(TagHelperNode):
|
||||
args: List[FilterExpression]
|
||||
func: Callable
|
||||
kwargs: Dict[str, FilterExpression]
|
||||
origin: django.template.base.Origin
|
||||
takes_context: Optional[bool]
|
||||
token: django.template.base.Token
|
||||
target_var: Optional[str] = ...
|
||||
def __init__(
|
||||
self,
|
||||
func: Callable,
|
||||
takes_context: Optional[bool],
|
||||
args: List[FilterExpression],
|
||||
kwargs: Dict[str, FilterExpression],
|
||||
target_var: Optional[str],
|
||||
) -> None: ...
|
||||
def render(self, context: Context) -> str: ...
|
||||
|
||||
class InclusionNode(TagHelperNode):
|
||||
args: List[FilterExpression]
|
||||
func: Callable
|
||||
kwargs: Dict[str, FilterExpression]
|
||||
origin: django.template.base.Origin
|
||||
takes_context: Optional[bool]
|
||||
token: django.template.base.Token
|
||||
filename: Union[django.template.base.Template, str] = ...
|
||||
def __init__(
|
||||
self,
|
||||
func: Callable,
|
||||
takes_context: Optional[bool],
|
||||
args: List[FilterExpression],
|
||||
kwargs: Dict[str, FilterExpression],
|
||||
filename: Optional[Union[Template, str]],
|
||||
) -> None: ...
|
||||
def render(self, context: Context) -> SafeText: ...
|
||||
|
||||
def parse_bits(
|
||||
parser: Parser,
|
||||
bits: List[str],
|
||||
params: List[str],
|
||||
varargs: Optional[str],
|
||||
varkw: Optional[str],
|
||||
defaults: Optional[Tuple[Union[bool, str]]],
|
||||
kwonly: List[str],
|
||||
kwonly_defaults: Optional[Dict[str, int]],
|
||||
takes_context: Optional[bool],
|
||||
name: str,
|
||||
) -> Tuple[List[FilterExpression], Dict[str, FilterExpression]]: ...
|
||||
def import_library(name: str) -> Library: ...
|
||||
20
django-stubs-generated/template/loader.pyi
Normal file
20
django-stubs-generated/template/loader.pyi
Normal file
@@ -0,0 +1,20 @@
|
||||
from typing import Dict, List, Optional, Union
|
||||
|
||||
from django.core.handlers.wsgi import WSGIRequest
|
||||
from django.template.backends.django import Template as DjangoTemplate
|
||||
from django.template.backends.dummy import Template as DummyTemplate
|
||||
from django.template.backends.jinja2 import Template as Jinja2Template
|
||||
|
||||
|
||||
def get_template(
|
||||
template_name: str, using: Optional[str] = ...
|
||||
) -> Union[DjangoTemplate, DummyTemplate, Jinja2Template]: ...
|
||||
def select_template(
|
||||
template_name_list: Union[List[str], str], using: Optional[str] = ...
|
||||
) -> Union[DjangoTemplate, DummyTemplate, Jinja2Template]: ...
|
||||
def render_to_string(
|
||||
template_name: Union[List[str], str],
|
||||
context: Optional[Union[Dict[str, bool], Dict[str, str]]] = ...,
|
||||
request: Optional[WSGIRequest] = ...,
|
||||
using: Optional[str] = ...,
|
||||
) -> str: ...
|
||||
81
django-stubs-generated/template/loader_tags.pyi
Normal file
81
django-stubs-generated/template/loader_tags.pyi
Normal file
@@ -0,0 +1,81 @@
|
||||
from typing import Any, Dict, List, Optional, Union
|
||||
|
||||
from django.template.base import (FilterExpression, Node, NodeList, Parser,
|
||||
Template, Token)
|
||||
from django.template.context import Context
|
||||
from django.utils.safestring import SafeText
|
||||
|
||||
from .base import (Node, Template, TemplateSyntaxError, TextNode, Variable,
|
||||
token_kwargs)
|
||||
from .library import Library
|
||||
|
||||
register: Any
|
||||
BLOCK_CONTEXT_KEY: str
|
||||
|
||||
class BlockContext:
|
||||
blocks: collections.defaultdict = ...
|
||||
def __init__(self) -> None: ...
|
||||
def add_blocks(self, blocks: Dict[str, BlockNode]) -> None: ...
|
||||
def pop(self, name: str) -> BlockNode: ...
|
||||
def push(self, name: str, block: BlockNode) -> None: ...
|
||||
def get_block(self, name: str) -> BlockNode: ...
|
||||
|
||||
class BlockNode(Node):
|
||||
context: django.template.context.Context
|
||||
name: str
|
||||
nodelist: django.template.base.NodeList
|
||||
origin: django.template.base.Origin
|
||||
parent: None
|
||||
token: django.template.base.Token
|
||||
def __init__(
|
||||
self, name: str, nodelist: NodeList, parent: None = ...
|
||||
) -> None: ...
|
||||
def render(self, context: Context) -> SafeText: ...
|
||||
def super(self) -> SafeText: ...
|
||||
|
||||
class ExtendsNode(Node):
|
||||
origin: django.template.base.Origin
|
||||
token: django.template.base.Token
|
||||
must_be_first: bool = ...
|
||||
context_key: str = ...
|
||||
nodelist: django.template.base.NodeList = ...
|
||||
parent_name: Union[
|
||||
django.template.base.FilterExpression, django.template.base.Node
|
||||
] = ...
|
||||
template_dirs: Optional[List[Any]] = ...
|
||||
blocks: Dict[str, django.template.loader_tags.BlockNode] = ...
|
||||
def __init__(
|
||||
self,
|
||||
nodelist: NodeList,
|
||||
parent_name: Union[FilterExpression, Node],
|
||||
template_dirs: Optional[List[Any]] = ...,
|
||||
) -> None: ...
|
||||
def find_template(
|
||||
self, template_name: str, context: Context
|
||||
) -> Template: ...
|
||||
def get_parent(self, context: Context) -> Template: ...
|
||||
def render(self, context: Context) -> Any: ...
|
||||
|
||||
class IncludeNode(Node):
|
||||
origin: django.template.base.Origin
|
||||
token: django.template.base.Token
|
||||
context_key: str = ...
|
||||
template: django.template.base.FilterExpression = ...
|
||||
extra_context: Dict[str, django.template.base.FilterExpression] = ...
|
||||
isolated_context: bool = ...
|
||||
def __init__(
|
||||
self,
|
||||
template: FilterExpression,
|
||||
*args: Any,
|
||||
extra_context: Optional[Any] = ...,
|
||||
isolated_context: bool = ...,
|
||||
**kwargs: Any
|
||||
) -> None: ...
|
||||
def render(self, context: Context) -> SafeText: ...
|
||||
|
||||
def do_block(parser: Parser, token: Token) -> BlockNode: ...
|
||||
def construct_relative_path(
|
||||
current_template_name: Optional[str], relative_name: str
|
||||
) -> str: ...
|
||||
def do_extends(parser: Parser, token: Token) -> ExtendsNode: ...
|
||||
def do_include(parser: Parser, token: Token) -> IncludeNode: ...
|
||||
11
django-stubs-generated/template/loaders/app_directories.pyi
Normal file
11
django-stubs-generated/template/loaders/app_directories.pyi
Normal file
@@ -0,0 +1,11 @@
|
||||
from typing import Optional, Tuple
|
||||
|
||||
from django.template import Engine
|
||||
|
||||
from .filesystem import Loader as FilesystemLoader
|
||||
|
||||
|
||||
class Loader(FilesystemLoader):
|
||||
dirs: None
|
||||
engine: Engine
|
||||
def get_dirs(self) -> Tuple: ...
|
||||
14
django-stubs-generated/template/loaders/base.pyi
Normal file
14
django-stubs-generated/template/loaders/base.pyi
Normal file
@@ -0,0 +1,14 @@
|
||||
from typing import Any, List, Optional
|
||||
|
||||
from django.template.base import Origin, Template
|
||||
from django.template.engine import Engine
|
||||
|
||||
|
||||
class Loader:
|
||||
engine: Any = ...
|
||||
def __init__(self, engine: Engine) -> None: ...
|
||||
def get_template(
|
||||
self, template_name: str, skip: Optional[List[Origin]] = ...
|
||||
) -> Template: ...
|
||||
def get_template_sources(self, template_name: Any) -> None: ...
|
||||
def reset(self) -> None: ...
|
||||
30
django-stubs-generated/template/loaders/cached.pyi
Normal file
30
django-stubs-generated/template/loaders/cached.pyi
Normal file
@@ -0,0 +1,30 @@
|
||||
from typing import Any, Dict, List, Optional, Tuple, Union
|
||||
|
||||
from django.template.base import Origin, Template
|
||||
from django.template.engine import Engine
|
||||
|
||||
from .base import Loader as BaseLoader
|
||||
|
||||
|
||||
class Loader(BaseLoader):
|
||||
engine: django.template.engine.Engine
|
||||
template_cache: Dict[Any, Any] = ...
|
||||
get_template_cache: Dict[
|
||||
str, django.template.exceptions.TemplateDoesNotExist
|
||||
] = ...
|
||||
loaders: List[django.template.loaders.base.Loader] = ...
|
||||
def __init__(
|
||||
self,
|
||||
engine: Engine,
|
||||
loaders: Union[List[Tuple[str, Dict[str, str]]], List[str]],
|
||||
) -> None: ...
|
||||
def get_contents(self, origin: Origin) -> str: ...
|
||||
def get_template(
|
||||
self, template_name: str, skip: Optional[List[Origin]] = ...
|
||||
) -> Template: ...
|
||||
def get_template_sources(self, template_name: str) -> None: ...
|
||||
def cache_key(
|
||||
self, template_name: str, skip: Optional[List[Origin]] = ...
|
||||
) -> str: ...
|
||||
def generate_hash(self, values: List[str]) -> str: ...
|
||||
def reset(self) -> None: ...
|
||||
19
django-stubs-generated/template/loaders/filesystem.pyi
Normal file
19
django-stubs-generated/template/loaders/filesystem.pyi
Normal file
@@ -0,0 +1,19 @@
|
||||
from typing import Any, Iterator, List, Optional, Union
|
||||
|
||||
from django.template.base import Origin
|
||||
from django.template.engine import Engine
|
||||
|
||||
from .base import Loader as BaseLoader
|
||||
|
||||
|
||||
class Loader(BaseLoader):
|
||||
engine: django.template.engine.Engine
|
||||
dirs: Optional[List[str]] = ...
|
||||
def __init__(
|
||||
self, engine: Engine, dirs: Optional[List[str]] = ...
|
||||
) -> None: ...
|
||||
def get_dirs(self) -> Union[List[bytes], List[str]]: ...
|
||||
def get_contents(self, origin: Origin) -> Any: ...
|
||||
def get_template_sources(
|
||||
self, template_name: Union[bytes, str]
|
||||
) -> Iterator[Origin]: ...
|
||||
16
django-stubs-generated/template/loaders/locmem.pyi
Normal file
16
django-stubs-generated/template/loaders/locmem.pyi
Normal file
@@ -0,0 +1,16 @@
|
||||
from typing import Dict, Iterator
|
||||
|
||||
from django.template.base import Origin
|
||||
from django.template.engine import Engine
|
||||
|
||||
from .base import Loader as BaseLoader
|
||||
|
||||
|
||||
class Loader(BaseLoader):
|
||||
engine: Engine
|
||||
templates_dict: Dict[str, str] = ...
|
||||
def __init__(
|
||||
self, engine: Engine, templates_dict: Dict[str, str]
|
||||
) -> None: ...
|
||||
def get_contents(self, origin: Origin) -> str: ...
|
||||
def get_template_sources(self, template_name: str) -> Iterator[Origin]: ...
|
||||
96
django-stubs-generated/template/response.pyi
Normal file
96
django-stubs-generated/template/response.pyi
Normal file
@@ -0,0 +1,96 @@
|
||||
from datetime import datetime
|
||||
from http.cookies import SimpleCookie
|
||||
from typing import Any, Callable, Dict, List, Optional, Tuple, Union
|
||||
from unittest.mock import MagicMock
|
||||
|
||||
from django.db.models.base import Model
|
||||
from django.http import HttpResponse
|
||||
from django.http.request import HttpRequest
|
||||
from django.template.backends.django import Template
|
||||
from django.template.backends.jinja2 import Template
|
||||
from django.views.generic.base import TemplateResponseMixin
|
||||
|
||||
from .loader import get_template as get_template, select_template as select_template
|
||||
|
||||
|
||||
class ContentNotRenderedError(Exception): ...
|
||||
|
||||
class SimpleTemplateResponse(HttpResponse):
|
||||
closed: bool
|
||||
cookies: SimpleCookie
|
||||
status_code: int
|
||||
rendering_attrs: Any = ...
|
||||
template_name: Union[
|
||||
List[str], Template, str
|
||||
] = ...
|
||||
context_data: Optional[Dict[str, str]] = ...
|
||||
using: Optional[str] = ...
|
||||
def __init__(
|
||||
self,
|
||||
template: Union[List[str], Template, str],
|
||||
context: Optional[Dict[str, Any]] = ...,
|
||||
content_type: Optional[str] = ...,
|
||||
status: Optional[int] = ...,
|
||||
charset: Optional[str] = ...,
|
||||
using: Optional[str] = ...,
|
||||
) -> None: ...
|
||||
def resolve_template(
|
||||
self, template: Union[List[str], Template, str]
|
||||
) -> Union[Template, Template]: ...
|
||||
def resolve_context(
|
||||
self,
|
||||
context: Optional[Dict[str, Any]],
|
||||
) -> Optional[Dict[str, Any]]: ...
|
||||
@property
|
||||
def rendered_content(self) -> str: ...
|
||||
def add_post_render_callback(self, callback: Callable) -> None: ...
|
||||
content: Any = ...
|
||||
def render(self) -> SimpleTemplateResponse: ...
|
||||
@property
|
||||
def is_rendered(self) -> bool: ...
|
||||
def __iter__(self) -> Any: ...
|
||||
@property
|
||||
def content(self): ...
|
||||
@content.setter
|
||||
def content(self, value: Any) -> None: ...
|
||||
|
||||
class TemplateResponse(SimpleTemplateResponse):
|
||||
client: django.test.client.Client
|
||||
closed: bool
|
||||
context: django.template.context.RequestContext
|
||||
context_data: Optional[Dict[str, Any]]
|
||||
cookies: SimpleCookie
|
||||
csrf_cookie_set: bool
|
||||
json: functools.partial
|
||||
redirect_chain: List[Tuple[str, int]]
|
||||
request: Dict[str, Union[django.test.client.FakePayload, int, str]]
|
||||
resolver_match: django.utils.functional.SimpleLazyObject
|
||||
status_code: int
|
||||
template_name: Union[
|
||||
List[str], django.template.backends.django.Template, str
|
||||
]
|
||||
templates: List[django.template.base.Template]
|
||||
using: Optional[str]
|
||||
wsgi_request: django.core.handlers.wsgi.WSGIRequest
|
||||
rendering_attrs: Any = ...
|
||||
def __init__(
|
||||
self,
|
||||
request: HttpRequest,
|
||||
template: Union[List[str], Template, str],
|
||||
context: Optional[
|
||||
Union[
|
||||
Dict[
|
||||
str, List[Dict[str, Optional[Union[datetime, Model, str]]]]
|
||||
],
|
||||
Dict[str, List[str]],
|
||||
Dict[str, Model],
|
||||
Dict[str, TemplateResponseMixin],
|
||||
Dict[str, str],
|
||||
MagicMock,
|
||||
]
|
||||
] = ...,
|
||||
content_type: Optional[str] = ...,
|
||||
status: Optional[int] = ...,
|
||||
charset: None = ...,
|
||||
using: Optional[str] = ...,
|
||||
) -> None: ...
|
||||
54
django-stubs-generated/template/smartif.pyi
Normal file
54
django-stubs-generated/template/smartif.pyi
Normal file
@@ -0,0 +1,54 @@
|
||||
from typing import Any, Dict, List, Optional, Union
|
||||
|
||||
from django.template.defaulttags import TemplateLiteral
|
||||
|
||||
|
||||
class TokenBase:
|
||||
id: Any = ...
|
||||
value: Any = ...
|
||||
first: Any = ...
|
||||
second: Any = ...
|
||||
def nud(self, parser: Any) -> None: ...
|
||||
def led(self, left: Any, parser: Any) -> None: ...
|
||||
def display(self): ...
|
||||
|
||||
def infix(bp: Any, func: Any): ...
|
||||
def prefix(bp: Any, func: Any): ...
|
||||
|
||||
OPERATORS: Any
|
||||
|
||||
class Literal(TokenBase):
|
||||
id: str = ...
|
||||
lbp: int = ...
|
||||
value: Optional[Union[List[int], int]] = ...
|
||||
def __init__(self, value: Optional[Union[List[int], int]]) -> None: ...
|
||||
def display(self): ...
|
||||
def nud(self, parser: IfParser) -> Literal: ...
|
||||
def eval(
|
||||
self, context: Dict[Any, Any]
|
||||
) -> Optional[Union[List[int], int]]: ...
|
||||
|
||||
class EndToken(TokenBase):
|
||||
lbp: int = ...
|
||||
def nud(self, parser: Any) -> None: ...
|
||||
|
||||
class IfParser:
|
||||
error_class: Any = ...
|
||||
tokens: Any = ...
|
||||
pos: int = ...
|
||||
current_token: Any = ...
|
||||
def __init__(
|
||||
self,
|
||||
tokens: Union[
|
||||
List[Optional[Union[List[int], str]]],
|
||||
List[Optional[Union[int, str]]],
|
||||
List[Union[List[int], int, str]],
|
||||
],
|
||||
) -> None: ...
|
||||
def translate_token(
|
||||
self, token: Optional[Union[List[int], int, str]]
|
||||
) -> Literal: ...
|
||||
def next_token(self) -> Literal: ...
|
||||
def parse(self) -> TemplateLiteral: ...
|
||||
def expression(self, rbp: int = ...) -> Literal: ...
|
||||
def create_var(self, value: Optional[Union[List[int], int]]) -> Literal: ...
|
||||
21
django-stubs-generated/template/utils.pyi
Normal file
21
django-stubs-generated/template/utils.pyi
Normal file
@@ -0,0 +1,21 @@
|
||||
import collections
|
||||
from collections import OrderedDict
|
||||
from typing import Any, Dict, List, Tuple, Union
|
||||
|
||||
from django.core.exceptions import ImproperlyConfigured
|
||||
from django.template.backends.base import BaseEngine
|
||||
|
||||
|
||||
class InvalidTemplateEngineError(ImproperlyConfigured): ...
|
||||
|
||||
class EngineHandler:
|
||||
templates: collections.OrderedDict
|
||||
def __init__(
|
||||
self, templates: List[Dict[str, Union[Dict[str, bool], str]]] = ...
|
||||
) -> None: ...
|
||||
def templates(self) -> OrderedDict: ...
|
||||
def __getitem__(self, alias: str) -> BaseEngine: ...
|
||||
def __iter__(self) -> Any: ...
|
||||
def all(self) -> List[BaseEngine]: ...
|
||||
|
||||
def get_app_template_dirs(dirname: str) -> Tuple: ...
|
||||
Reference in New Issue
Block a user