mirror of
https://github.com/davidhalter/django-stubs.git
synced 2025-12-24 04:41:31 +08:00
better stubs
This commit is contained in:
@@ -1,19 +1,16 @@
|
||||
# Stubs for django.template.backends.base (Python 3.6)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
from typing import Any, Dict, Iterator, List, Optional, Tuple, Union
|
||||
|
||||
from typing import Any
|
||||
|
||||
from typing import Dict, Iterator, List, Tuple, Union
|
||||
|
||||
class BaseEngine:
|
||||
name: Any = ...
|
||||
dirs: Any = ...
|
||||
app_dirs: Any = ...
|
||||
def __init__(self, params: Dict[str, Union[str, bool, List[str]]]) -> None: ...
|
||||
def __init__(
|
||||
self, params: Dict[str, Union[str, List[str], bool, List[Any]]]
|
||||
) -> 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: ...
|
||||
def template_dirs(self) -> Tuple[str]: ...
|
||||
def iter_template_filenames(self, template_name: str) -> Iterator[str]: ...
|
||||
|
||||
@@ -1,19 +1,19 @@
|
||||
# Stubs for django.template.backends.django (Python 3.6)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
|
||||
from .base import BaseEngine
|
||||
from typing import Any, Optional
|
||||
|
||||
from django.http.request import HttpRequest
|
||||
from django.template.base import Template
|
||||
from django.template.exceptions import TemplateDoesNotExist
|
||||
from django.utils.safestring import SafeText
|
||||
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: Any = ...
|
||||
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: ...
|
||||
@@ -22,11 +22,13 @@ class DjangoTemplates(BaseEngine):
|
||||
) -> Dict[str, str]: ...
|
||||
|
||||
class Template:
|
||||
template: Any = ...
|
||||
backend: Any = ...
|
||||
def __init__(self, template: Template, backend: DjangoTemplates) -> None: ...
|
||||
template: django.template.base.Template = ...
|
||||
backend: django.template.backends.django.DjangoTemplates = ...
|
||||
def __init__(
|
||||
self, template: Template, backend: DjangoTemplates
|
||||
) -> None: ...
|
||||
@property
|
||||
def origin(self): ...
|
||||
def origin(self) -> Origin: ...
|
||||
def render(
|
||||
self, context: Any = ..., request: Optional[HttpRequest] = ...
|
||||
) -> SafeText: ...
|
||||
@@ -34,6 +36,6 @@ class Template:
|
||||
def copy_exception(
|
||||
exc: TemplateDoesNotExist, backend: Optional[DjangoTemplates] = ...
|
||||
) -> TemplateDoesNotExist: ...
|
||||
def reraise(exc: TemplateDoesNotExist, backend: DjangoTemplates) -> None: ...
|
||||
def reraise(exc: TemplateDoesNotExist, backend: DjangoTemplates) -> Any: ...
|
||||
def get_installed_libraries() -> Dict[str, str]: ...
|
||||
def get_package_libraries(pkg: Any) -> Iterator[str]: ...
|
||||
|
||||
@@ -1,22 +1,28 @@
|
||||
# Stubs for django.template.backends.dummy (Python 3.6)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
|
||||
import string
|
||||
from .base import BaseEngine
|
||||
from .utils import csrf_input_lazy, csrf_token_lazy
|
||||
from typing import Any, Optional
|
||||
from typing import Any, Dict, List, Optional, Union
|
||||
|
||||
from django.http.request import HttpRequest
|
||||
from typing import Dict, Optional, Union
|
||||
|
||||
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[bool, str]]) -> None: ...
|
||||
def from_string(self, template_code: Any): ...
|
||||
def __init__(
|
||||
self, params: Dict[str, Union[List[Any], bool, str, Dict[Any, Any]]]
|
||||
) -> 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] = ...
|
||||
self,
|
||||
context: Optional[Dict[str, str]] = ...,
|
||||
request: Optional[HttpRequest] = ...,
|
||||
) -> str: ...
|
||||
|
||||
41
django-stubs/template/backends/jinja2.pyi
Normal file
41
django-stubs/template/backends/jinja2.pyi
Normal file
@@ -0,0 +1,41 @@
|
||||
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 .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, Any]) -> 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: Any = ..., 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[str, List[Tuple[int, str]], int]]: ...
|
||||
@@ -1,12 +1,9 @@
|
||||
# Stubs for django.template.backends.utils (Python 3.6)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
|
||||
from typing import Any
|
||||
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
|
||||
|
||||
@@ -1,21 +1,15 @@
|
||||
# Stubs for django.template.base (Python 3.6)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
|
||||
from .exceptions import TemplateSyntaxError
|
||||
from enum import Enum
|
||||
from typing import Any, Optional
|
||||
from typing import Any, Callable, Dict, List, Optional, Tuple, Type, Union
|
||||
|
||||
from django.template.backends.dummy import TemplateStrings
|
||||
from django.contrib.admin.views.main import ChangeList
|
||||
from django.template.context import Context
|
||||
from django.template.defaulttags import LoadNode
|
||||
from django.template.engine import Engine
|
||||
from django.template.exceptions import TemplateSyntaxError
|
||||
from django.template.library import Library
|
||||
from django.template.loader_tags import BlockNode, ExtendsNode
|
||||
from django.template.loaders.base import Loader
|
||||
from django.template.loaders.filesystem import Loader
|
||||
from django.utils.safestring import SafeText
|
||||
from typing import Any, Callable, Dict, Iterator, List, Optional, Tuple, Type, Union
|
||||
|
||||
from .exceptions import TemplateSyntaxError
|
||||
|
||||
FILTER_SEPARATOR: str
|
||||
FILTER_ARGUMENT_SEPARATOR: str
|
||||
@@ -40,65 +34,89 @@ class TokenType(Enum):
|
||||
COMMENT: int = ...
|
||||
|
||||
class VariableDoesNotExist(Exception):
|
||||
msg: Any = ...
|
||||
params: Any = ...
|
||||
def __init__(self, msg: str, params: Any = ...) -> None: ...
|
||||
def __str__(self) -> str: ...
|
||||
|
||||
class Origin:
|
||||
name: Any = ...
|
||||
template_name: Any = ...
|
||||
loader: Any = ...
|
||||
msg: str = ...
|
||||
params: Union[
|
||||
Tuple[
|
||||
str,
|
||||
Union[
|
||||
int,
|
||||
django.urls.resolvers.URLResolver,
|
||||
Dict[Any, Any],
|
||||
django.contrib.admin.views.main.ChangeList,
|
||||
Dict[str, str],
|
||||
List[str],
|
||||
None,
|
||||
django.template.context.Context,
|
||||
Dict[str, int],
|
||||
Any,
|
||||
Dict[str, bool],
|
||||
Dict[str, Union[str, bool]],
|
||||
str,
|
||||
],
|
||||
],
|
||||
Tuple[Dict[str, str]],
|
||||
] = ...
|
||||
def __init__(
|
||||
self,
|
||||
name: str,
|
||||
template_name: Optional[str] = ...,
|
||||
loader: Optional[Union[Loader, TemplateStrings]] = ...,
|
||||
msg: str,
|
||||
params: Tuple[str, Optional[Union[Context, ChangeList]]] = ...,
|
||||
) -> None: ...
|
||||
|
||||
class Origin:
|
||||
name: str = ...
|
||||
template_name: Optional[Union[str, bytes]] = ...
|
||||
loader: Optional[
|
||||
Union[
|
||||
django.template.loaders.base.Loader,
|
||||
django.template.backends.dummy.TemplateStrings,
|
||||
]
|
||||
] = ...
|
||||
def __init__(
|
||||
self, name: str, template_name: str = ..., loader: Loader = ...
|
||||
) -> None: ...
|
||||
def __str__(self): ...
|
||||
def __eq__(self, other: Origin) -> bool: ...
|
||||
@property
|
||||
def loader_name(self) -> Optional[str]: ...
|
||||
def loader_name(self): ...
|
||||
|
||||
class Template:
|
||||
name: Any = ...
|
||||
origin: Any = ...
|
||||
engine: Any = ...
|
||||
source: Any = ...
|
||||
nodelist: Any = ...
|
||||
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] = ...,
|
||||
origin: Origin = ...,
|
||||
name: str = ...,
|
||||
engine: Engine = ...,
|
||||
) -> None: ...
|
||||
def __iter__(self) -> None: ...
|
||||
def _render(self, context: Any): ...
|
||||
def render(self, context: Context): ...
|
||||
def render(self, context: Context) -> Any: ...
|
||||
def compile_nodelist(self) -> NodeList: ...
|
||||
def get_exception_info(
|
||||
self, exception: Exception, token: Token
|
||||
) -> Dict[str, Union[str, List[Tuple[int, SafeText]], int]]: ...
|
||||
|
||||
def linebreak_iter(template_source: str) -> Iterator[int]: ...
|
||||
def linebreak_iter(template_source: Any) -> None: ...
|
||||
|
||||
class Token:
|
||||
lineno: Any = ...
|
||||
position: Any = ...
|
||||
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] = ...,
|
||||
lineno: int = ...,
|
||||
) -> None: ...
|
||||
def __str__(self): ...
|
||||
def split_contents(self) -> List[str]: ...
|
||||
|
||||
class Lexer:
|
||||
template_string: Any = ...
|
||||
verbatim: bool = ...
|
||||
template_string: str = ...
|
||||
verbatim: Union[str, bool] = ...
|
||||
def __init__(self, template_string: str) -> None: ...
|
||||
def tokenize(self) -> List[Token]: ...
|
||||
def create_token(
|
||||
@@ -110,42 +128,34 @@ class Lexer:
|
||||
) -> Token: ...
|
||||
|
||||
class DebugLexer(Lexer):
|
||||
template_string: str
|
||||
verbatim: Union[str, bool]
|
||||
def tokenize(self) -> List[Token]: ...
|
||||
|
||||
class Parser:
|
||||
tokens: Any = ...
|
||||
tags: Any = ...
|
||||
filters: Any = ...
|
||||
command_stack: Any = ...
|
||||
libraries: Any = ...
|
||||
origin: Any = ...
|
||||
tokens: Union[str, List[django.template.base.Token]] = ...
|
||||
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[str, List[Token]],
|
||||
libraries: Optional[Dict[str, Library]] = ...,
|
||||
tokens: List[Token],
|
||||
libraries: Dict[str, Library] = ...,
|
||||
builtins: List[Library] = ...,
|
||||
origin: Optional[Origin] = ...,
|
||||
origin: Origin = ...,
|
||||
) -> None: ...
|
||||
def parse(
|
||||
self,
|
||||
parse_until: Optional[
|
||||
Union[Tuple[str, str], Tuple[str], Tuple[str, str, 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[str, RuntimeError, TemplateSyntaxError]
|
||||
) -> Union[RuntimeError, TemplateSyntaxError]: ...
|
||||
def parse(self, parse_until: Optional[Tuple[str]] = ...) -> NodeList: ...
|
||||
def skip_past(self, endtag: Any): ...
|
||||
def extend_nodelist(
|
||||
self, nodelist: NodeList, node: Node, token: Token
|
||||
) -> None: ...
|
||||
def error(self, token: Any, e: Any): ...
|
||||
def invalid_block_tag(
|
||||
self,
|
||||
token: Token,
|
||||
command: str,
|
||||
parse_until: Union[Tuple[str], Tuple[str, str]] = ...,
|
||||
) -> None: ...
|
||||
def unclosed_block_tag(
|
||||
self, parse_until: Union[Tuple[str], Tuple[str, str, str]]
|
||||
self, token: Any, command: Any, parse_until: Optional[Any] = ...
|
||||
) -> None: ...
|
||||
def unclosed_block_tag(self, parse_until: Any) -> None: ...
|
||||
def next_token(self) -> Token: ...
|
||||
def prepend_token(self, token: Token) -> None: ...
|
||||
def delete_first_token(self) -> None: ...
|
||||
@@ -158,66 +168,69 @@ filter_raw_string: Any
|
||||
filter_re: Any
|
||||
|
||||
class FilterExpression:
|
||||
token: Any = ...
|
||||
filters: Any = ...
|
||||
var: Any = ...
|
||||
token: str = ...
|
||||
filters: Union[
|
||||
List[
|
||||
Tuple[Callable, List[Tuple[bool, django.utils.safestring.SafeText]]]
|
||||
],
|
||||
List[Tuple[Callable, List[Tuple[bool, django.template.base.Variable]]]],
|
||||
] = ...
|
||||
var: Union[
|
||||
django.utils.safestring.SafeText, django.template.base.Variable
|
||||
] = ...
|
||||
def __init__(self, token: str, parser: Parser) -> None: ...
|
||||
def resolve(
|
||||
self,
|
||||
context: Union[Dict[str, Dict[str, str]], Context],
|
||||
ignore_failures: bool = ...,
|
||||
) -> object: ...
|
||||
def resolve(self, context: Context, ignore_failures: bool = ...) -> Any: ...
|
||||
def args_check(
|
||||
name: str,
|
||||
func: Callable,
|
||||
provided: Union[List[Tuple[bool, SafeText]], List[Tuple[bool, Variable]]],
|
||||
provided: Union[
|
||||
List[Tuple[bool, Variable]], List[Tuple[bool, SafeText]]
|
||||
],
|
||||
) -> bool: ...
|
||||
args_check: Any = ...
|
||||
def __str__(self) -> str: ...
|
||||
|
||||
class Variable:
|
||||
var: Any = ...
|
||||
literal: Any = ...
|
||||
lookups: Any = ...
|
||||
var: Union[str, Dict[Any, Any]] = ...
|
||||
literal: Optional[Union[float, django.utils.safestring.SafeText]] = ...
|
||||
lookups: Optional[Tuple[str]] = ...
|
||||
translate: bool = ...
|
||||
message_context: Any = ...
|
||||
message_context: Optional[str] = ...
|
||||
def __init__(self, var: str) -> None: ...
|
||||
def resolve(self, context: Any) -> object: ...
|
||||
def __repr__(self): ...
|
||||
def __str__(self): ...
|
||||
def _resolve_lookup(self, context: Any) -> object: ...
|
||||
def resolve(self, context: Union[Context, Dict[Any, Any]]) -> 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 render_annotated(self, context: Context) -> str: ...
|
||||
def __iter__(self) -> None: ...
|
||||
def get_nodes_by_type(
|
||||
self, nodetype: Type[Node]
|
||||
) -> Union[List[LoadNode], List[VariableNode], List[BlockNode], List[ExtendsNode]]: ...
|
||||
self, nodetype: Type[Union[ExtendsNode, BlockNode]]
|
||||
) -> List[BlockNode]: ...
|
||||
|
||||
class NodeList(list):
|
||||
contains_nontext: bool = ...
|
||||
def render(self, context: Context) -> SafeText: ...
|
||||
def get_nodes_by_type(
|
||||
self, nodetype: Type[Node]
|
||||
) -> Union[List[BlockNode], List[VariableNode]]: ...
|
||||
self, nodetype: Type[Union[ExtendsNode, BlockNode]]
|
||||
) -> List[BlockNode]: ...
|
||||
|
||||
class TextNode(Node):
|
||||
s: Any = ...
|
||||
origin: django.template.base.Origin
|
||||
token: django.template.base.Token
|
||||
s: str = ...
|
||||
def __init__(self, s: str) -> None: ...
|
||||
def __repr__(self) -> str: ...
|
||||
def render(self, context: Context) -> str: ...
|
||||
|
||||
def render_value_in_context(value: object, context: Context) -> str: ...
|
||||
def render_value_in_context(value: Any, context: Context) -> SafeText: ...
|
||||
|
||||
class VariableNode(Node):
|
||||
filter_expression: Any = ...
|
||||
origin: django.template.base.Origin
|
||||
token: django.template.base.Token
|
||||
filter_expression: django.template.base.FilterExpression = ...
|
||||
def __init__(self, filter_expression: FilterExpression) -> None: ...
|
||||
def __repr__(self) -> str: ...
|
||||
def render(self, context: Context) -> str: ...
|
||||
def render(self, context: Context) -> SafeText: ...
|
||||
|
||||
kwarg_re: Any
|
||||
|
||||
|
||||
@@ -1,69 +1,58 @@
|
||||
# Stubs for django.template.context (Python 3.6)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
|
||||
from typing import Any, Optional
|
||||
|
||||
from django.core.handlers.wsgi import WSGIRequest
|
||||
from django.db.models.options import Options
|
||||
from django.http.request import HttpRequest
|
||||
from django.template.base import Origin, Template
|
||||
from django.template.defaulttags import CycleNode
|
||||
from django.template.library import InclusionNode
|
||||
from django.template.loader_tags import BlockContext
|
||||
from itertools import cycle
|
||||
from typing import Any, Callable, Dict, Iterator, List, Optional, Type, Union
|
||||
from typing import Any, Dict, Iterator, List, Optional, Union
|
||||
|
||||
from django.contrib.admin.templatetags.base import InclusionAdminNode
|
||||
from django.core.handlers.wsgi import WSGIRequest
|
||||
from django.template.base import Node, Origin, Template
|
||||
from django.template.defaulttags import CycleNode
|
||||
from django.template.loader_tags import BlockContext
|
||||
from django.utils.functional import SimpleLazyObject
|
||||
|
||||
_builtin_context_processors: Any
|
||||
|
||||
class ContextPopException(Exception): ...
|
||||
|
||||
class ContextDict(dict):
|
||||
context: Any = ...
|
||||
def __init__(self, context: BaseContext, *args: Any, **kwargs: Any) -> None: ...
|
||||
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: ...
|
||||
dicts: Any = ...
|
||||
def _reset_dicts(self, value: Any = ...) -> None: ...
|
||||
def __copy__(self) -> BaseContext: ...
|
||||
def __repr__(self) -> str: ...
|
||||
def __iter__(self) -> None: ...
|
||||
def push(self, *args: Any, **kwargs: Any) -> ContextDict: ...
|
||||
def pop(self) -> ContextDict: ...
|
||||
def __setitem__(
|
||||
self, key: Union[str, CycleNode, InclusionNode], value: Any
|
||||
) -> None: ...
|
||||
def set_upward(self, key: str, value: Union[str, int]) -> None: ...
|
||||
def __getitem__(self, key: Union[str, int]) -> object: ...
|
||||
def __setitem__(self, key: Union[str, Node], value: Any) -> None: ...
|
||||
def set_upward(self, key: Any, value: Any) -> None: ...
|
||||
def __getitem__(self, key: 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]]: ...
|
||||
) -> Union[SimpleLazyObject, int]: ...
|
||||
def setdefault(
|
||||
self, key: str, default: Union[List[Origin], int] = ...
|
||||
) -> Union[List[Origin], int]: ...
|
||||
def new(self, values: Any = ...) -> Context: ...
|
||||
def flatten(
|
||||
self
|
||||
) -> Dict[str, Optional[Union[int, str, Dict[str, Union[Type[object], str]]]]]: ...
|
||||
def __eq__(self, other: Context) -> bool: ...
|
||||
self, key: str, default: List[Origin] = ...
|
||||
) -> List[Origin]: ...
|
||||
def new(self, values: Any = ...) -> RequestContext: ...
|
||||
def flatten(self): ...
|
||||
def __eq__(self, other: Any): ...
|
||||
|
||||
class Context(BaseContext):
|
||||
autoescape: Any = ...
|
||||
use_l10n: Any = ...
|
||||
use_tz: Any = ...
|
||||
template_name: str = ...
|
||||
render_context: Any = ...
|
||||
template: Any = ...
|
||||
dicts: List
|
||||
autoescape: bool = ...
|
||||
use_l10n: Optional[bool] = ...
|
||||
use_tz: None = ...
|
||||
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_l10n: None = ...,
|
||||
use_tz: None = ...,
|
||||
) -> None: ...
|
||||
def bind_template(self, template: Template) -> Iterator[None]: ...
|
||||
@@ -71,36 +60,64 @@ class Context(BaseContext):
|
||||
def update(self, other_dict: Dict[str, Any]) -> ContextDict: ...
|
||||
|
||||
class RenderContext(BaseContext):
|
||||
template: Any = ...
|
||||
dicts: Union[
|
||||
List[
|
||||
Dict[
|
||||
Union[str, django.template.loader_tags.IncludeNode],
|
||||
Union[bool, None, Dict[str, django.template.base.Template]],
|
||||
]
|
||||
],
|
||||
List[
|
||||
Union[
|
||||
Dict[
|
||||
Union[str, django.template.loader_tags.IncludeNode],
|
||||
Union[bool, None, Dict[Any, Any]],
|
||||
],
|
||||
django.template.context.ContextDict,
|
||||
]
|
||||
],
|
||||
List[
|
||||
Union[
|
||||
Dict[str, Union[bool, None]],
|
||||
Dict[str, str],
|
||||
django.template.context.ContextDict,
|
||||
]
|
||||
],
|
||||
]
|
||||
template: Optional[django.template.base.Template] = ...
|
||||
def __iter__(self) -> None: ...
|
||||
def __contains__(self, key: Union[str, CycleNode]) -> bool: ...
|
||||
def get(
|
||||
self, key: Union[str, InclusionNode], otherwise: None = ...
|
||||
) -> Optional[Union[Template, BlockContext]]: ...
|
||||
self, key: Union[str, InclusionAdminNode], otherwise: None = ...
|
||||
) -> Optional[Union[BlockContext, Template]]: ...
|
||||
def __getitem__(
|
||||
self, key: Union[str, CycleNode]
|
||||
) -> Union[BlockContext, List[Origin], cycle]: ...
|
||||
) -> Union[List[Origin], BlockContext, cycle]: ...
|
||||
def push_state(
|
||||
self, template: Template, isolated_context: bool = ...
|
||||
) -> Iterator[None]: ...
|
||||
|
||||
class RequestContext(Context):
|
||||
request: Any = ...
|
||||
_processors: Any = ...
|
||||
_processors_index: Any = ...
|
||||
autoescape: bool
|
||||
dicts: List
|
||||
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,
|
||||
request: WSGIRequest,
|
||||
dict_: None = ...,
|
||||
processors: Optional[List[Callable]] = ...,
|
||||
processors: None = ...,
|
||||
use_l10n: None = ...,
|
||||
use_tz: None = ...,
|
||||
autoescape: bool = ...,
|
||||
) -> None: ...
|
||||
template: Any = ...
|
||||
template: Optional[django.template.base.Template] = ...
|
||||
def bind_template(self, template: Template) -> Iterator[None]: ...
|
||||
def new(self, values: Any = ...) -> RequestContext: ...
|
||||
|
||||
def make_context(
|
||||
context: Any, request: Optional[WSGIRequest] = ..., **kwargs: Any
|
||||
context: Dict[str, Any], request: Optional[WSGIRequest] = ..., **kwargs: Any
|
||||
) -> Context: ...
|
||||
|
||||
@@ -1,18 +1,16 @@
|
||||
# Stubs for django.template.context_processors (Python 3.6)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
|
||||
from typing import Any
|
||||
from typing import Any, Callable, Dict, List, Optional, Tuple, Union
|
||||
|
||||
from django.core.handlers.wsgi import WSGIRequest
|
||||
from django.http.request import HttpRequest
|
||||
from django.utils.functional import SimpleLazyObject
|
||||
from typing import Callable, Dict, List, Tuple, Union
|
||||
|
||||
|
||||
def csrf(request: HttpRequest) -> Dict[str, SimpleLazyObject]: ...
|
||||
def debug(request: HttpRequest) -> Dict[str, Union[bool, Callable]]: ...
|
||||
def i18n(request: WSGIRequest) -> Dict[str, Union[List[Tuple[str, str]], str, bool]]: ...
|
||||
def tz(request: Any): ...
|
||||
def static(request: Any): ...
|
||||
def i18n(
|
||||
request: WSGIRequest
|
||||
) -> Dict[str, Union[List[Tuple[str, str]], str, bool]]: ...
|
||||
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]: ...
|
||||
|
||||
@@ -1,39 +1,35 @@
|
||||
# Stubs for django.template.defaultfilters (Python 3.6)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
from datetime import date, time, 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, VariableDoesNotExist
|
||||
from .library import Library
|
||||
from typing import Any, Optional
|
||||
|
||||
from datetime import date, time, timedelta
|
||||
from decimal import Decimal
|
||||
from django.utils.safestring import SafeText
|
||||
from typing import Any, Callable, Dict, List, Optional, Tuple, Union
|
||||
|
||||
register: Any
|
||||
|
||||
def stringfilter(func: 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, str, float]], arg: Union[str, int] = ...
|
||||
text: Optional[Union[Decimal, float, str]], arg: Union[str, int] = ...
|
||||
) -> 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: object, arg: str) -> str: ...
|
||||
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[str, int]) -> str: ...
|
||||
def truncatewords(value: str, arg: Union[SafeText, int]) -> str: ...
|
||||
def truncatewords_html(value: str, arg: int) -> str: ...
|
||||
def truncatewords(value: str, arg: Union[str, int]) -> str: ...
|
||||
def truncatewords_html(value: str, arg: Union[str, int]) -> str: ...
|
||||
def upper(value: str) -> str: ...
|
||||
def urlencode(value: str, safe: None = ...) -> 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 = ...
|
||||
@@ -42,7 +38,7 @@ 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: SafeText) -> 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: ...
|
||||
@@ -51,40 +47,62 @@ 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 _property_resolver(arg: Union[str, int]) -> Callable: ...
|
||||
def dictsort(
|
||||
value: Union[
|
||||
List[Dict[str, Union[str, int]]], List[Dict[str, str]], List[Tuple[str, str]]
|
||||
],
|
||||
arg: Union[str, int],
|
||||
value: Any, arg: Union[str, int]
|
||||
) -> Union[
|
||||
List[Dict[str, Union[str, int]]], List[Dict[str, str]], List[Tuple[str, str]]
|
||||
List[Tuple[str, str]],
|
||||
List[Dict[str, Union[int, str]]],
|
||||
str,
|
||||
List[Dict[str, Dict[str, Union[int, str]]]],
|
||||
]: ...
|
||||
def dictsortreversed(value: str, arg: str) -> str: ...
|
||||
def first(value: Union[str, List[str]]) -> str: ...
|
||||
def join(value: object, arg: str, autoescape: bool = ...) -> object: ...
|
||||
def dictsortreversed(
|
||||
value: Any, arg: Union[str, int]
|
||||
) -> Union[str, List[Tuple[str, str]], List[Dict[str, Union[int, str]]]]: ...
|
||||
def first(value: Union[str, List[int], List[str]]) -> Union[str, int]: ...
|
||||
def join(value: Any, arg: str, autoescape: bool = ...) -> Any: ...
|
||||
def last(value: List[str]) -> str: ...
|
||||
def length(value: Any) -> int: ...
|
||||
def length_is(value: Any, arg: Union[SafeText, int]) -> Union[bool, str]: ...
|
||||
def random(value: Union[List[str], List[SafeText]]) -> str: ...
|
||||
def slice_filter(value: str, arg: str) -> str: ...
|
||||
def unordered_list(value: Any, autoescape: bool = ...) -> SafeText: ...
|
||||
def random(value: List[str]) -> str: ...
|
||||
def slice_filter(value: Any, arg: str) -> Any: ...
|
||||
def unordered_list(
|
||||
value: Union[
|
||||
List[Union[List[str], str]],
|
||||
List[Union[str, List[SafeText]]],
|
||||
Iterator[Any],
|
||||
List[Union[str, List[Union[List[str], str]]]],
|
||||
List[Union[str, List[Union[str, List[Union[List[str], str]]]]]],
|
||||
],
|
||||
autoescape: bool = ...,
|
||||
) -> SafeText: ...
|
||||
def add(
|
||||
value: Union[date, Tuple[int, int], str, int],
|
||||
arg: Union[SafeText, Tuple[int, int], timedelta, int],
|
||||
) -> Union[str, Tuple[int, int, int, int], date, int]: ...
|
||||
def get_digit(value: int, arg: int) -> int: ...
|
||||
def date(value: Optional[Union[time, date, str]], arg: Optional[str] = ...) -> str: ...
|
||||
def time(value: Optional[Union[time, str, date]], arg: Optional[str] = ...) -> str: ...
|
||||
def timesince_filter(value: Optional[date], arg: Optional[date] = ...) -> str: ...
|
||||
def timeuntil_filter(value: date, arg: Optional[date] = ...) -> str: ...
|
||||
value: Union[List[int], int, str, date, Tuple[int, int]],
|
||||
arg: Union[List[int], int, timedelta, str, Tuple[int, int]],
|
||||
) -> Union[List[int], int, str, date, Tuple[int, int, int, int]]: ...
|
||||
def get_digit(value: Union[str, int], arg: int) -> Union[str, int]: ...
|
||||
def date(
|
||||
value: Optional[Union[time, str, date]], arg: Optional[str] = ...
|
||||
) -> str: ...
|
||||
def time(
|
||||
value: Optional[Union[time, str, date]], 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[SafeText, int]
|
||||
) -> Union[int, str]: ...
|
||||
def default_if_none(value: Optional[str], arg: Union[str, int]) -> Union[str, int]: ...
|
||||
value: Optional[Union[str, int]], arg: Union[str, int]
|
||||
) -> Union[str, int]: ...
|
||||
def default_if_none(
|
||||
value: Optional[str], arg: Union[str, int]
|
||||
) -> Union[str, int]: ...
|
||||
def divisibleby(value: int, arg: int) -> bool: ...
|
||||
def yesno(value: Optional[int], arg: Optional[str] = ...) -> Optional[str]: ...
|
||||
def filesizeformat(bytes_: Union[str, int]) -> str: ...
|
||||
def pluralize(value: object, arg: str = ...) -> str: ...
|
||||
def yesno(
|
||||
value: Optional[int], arg: Optional[str] = ...
|
||||
) -> Optional[Union[str, bool]]: ...
|
||||
def filesizeformat(bytes_: Union[str, complex, int]) -> str: ...
|
||||
def pluralize(value: Any, arg: str = ...) -> str: ...
|
||||
def phone2numeric_filter(value: str) -> str: ...
|
||||
def pprint(value: object) -> str: ...
|
||||
def pprint(value: Any) -> str: ...
|
||||
|
||||
@@ -1,56 +1,48 @@
|
||||
# Stubs for django.template.defaulttags (Python 3.6)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
|
||||
from .base import (
|
||||
BLOCK_TAG_END,
|
||||
BLOCK_TAG_START,
|
||||
COMMENT_TAG_END,
|
||||
COMMENT_TAG_START,
|
||||
Context,
|
||||
FILTER_SEPARATOR,
|
||||
Node,
|
||||
NodeList,
|
||||
SINGLE_BRACE_END,
|
||||
SINGLE_BRACE_START,
|
||||
TemplateSyntaxError,
|
||||
VARIABLE_ATTRIBUTE_SEPARATOR,
|
||||
VARIABLE_TAG_END,
|
||||
VARIABLE_TAG_START,
|
||||
VariableDoesNotExist,
|
||||
kwarg_re,
|
||||
render_value_in_context,
|
||||
token_kwargs,
|
||||
)
|
||||
from .defaultfilters import date
|
||||
from .library import Library
|
||||
from .smartif import IfParser, Literal
|
||||
from collections import namedtuple
|
||||
from typing import Any, Optional
|
||||
|
||||
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 typing import Any, Dict, List, Optional, Tuple, Union
|
||||
|
||||
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):
|
||||
cyclevars: Any = ...
|
||||
variable_name: Any = ...
|
||||
silent: Any = ...
|
||||
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],
|
||||
@@ -61,120 +53,179 @@ class CycleNode(Node):
|
||||
def reset(self, context: Context) -> None: ...
|
||||
|
||||
class DebugNode(Node):
|
||||
def render(self, context: Any): ...
|
||||
origin: django.template.base.Origin
|
||||
token: django.template.base.Token
|
||||
def render(self, context: Context) -> str: ...
|
||||
|
||||
class FilterNode(Node):
|
||||
def __init__(self, filter_expr: FilterExpression, nodelist: NodeList) -> None: ...
|
||||
def render(self, context: Context): ...
|
||||
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):
|
||||
vars: Any = ...
|
||||
asvar: Any = ...
|
||||
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[str, List[str]]
|
||||
origin: django.template.base.Origin
|
||||
sequence: Union[str, django.template.base.FilterExpression]
|
||||
token: django.template.base.Token
|
||||
child_nodelists: Any = ...
|
||||
is_reversed: Any = ...
|
||||
nodelist_loop: Any = ...
|
||||
nodelist_empty: Any = ...
|
||||
is_reversed: bool = ...
|
||||
nodelist_loop: Union[django.template.base.NodeList, List[str]] = ...
|
||||
nodelist_empty: Union[django.template.base.NodeList, List[str]] = ...
|
||||
def __init__(
|
||||
self,
|
||||
loopvars: List[str],
|
||||
sequence: FilterExpression,
|
||||
loopvars: Union[str, List[str]],
|
||||
sequence: Union[str, FilterExpression],
|
||||
is_reversed: bool,
|
||||
nodelist_loop: NodeList,
|
||||
nodelist_empty: Optional[NodeList] = ...,
|
||||
nodelist_loop: Union[NodeList, List[str]],
|
||||
nodelist_empty: Optional[Union[NodeList, List[str]]] = ...,
|
||||
) -> None: ...
|
||||
def __repr__(self) -> str: ...
|
||||
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 = ...
|
||||
_varlist: Any = ...
|
||||
def __init__(
|
||||
self, nodelist_true: NodeList, nodelist_false: NodeList, *varlist: Any
|
||||
) -> None: ...
|
||||
def render(self, context: Context) -> str: ...
|
||||
def _get_context_stack_frame(self, context: Context) -> Any: ...
|
||||
|
||||
class IfEqualNode(Node):
|
||||
nodelist_false: Union[django.template.base.NodeList, List[Any]]
|
||||
nodelist_true: Union[django.template.base.NodeList, List[Any]]
|
||||
origin: django.template.base.Origin
|
||||
token: django.template.base.Token
|
||||
var1: Union[str, django.template.base.FilterExpression]
|
||||
var2: Union[str, django.template.base.FilterExpression]
|
||||
child_nodelists: Any = ...
|
||||
negate: Any = ...
|
||||
negate: bool = ...
|
||||
def __init__(
|
||||
self,
|
||||
var1: FilterExpression,
|
||||
var2: FilterExpression,
|
||||
nodelist_true: NodeList,
|
||||
nodelist_false: NodeList,
|
||||
var1: Union[str, FilterExpression],
|
||||
var2: Union[str, FilterExpression],
|
||||
nodelist_true: Union[NodeList, List[Any]],
|
||||
nodelist_false: Union[NodeList, List[Any]],
|
||||
negate: bool,
|
||||
) -> None: ...
|
||||
def __repr__(self): ...
|
||||
def render(self, context: Context) -> SafeText: ...
|
||||
|
||||
class IfNode(Node):
|
||||
conditions_nodelists: Any = ...
|
||||
origin: django.template.base.Origin
|
||||
token: django.template.base.Token
|
||||
conditions_nodelists: Union[
|
||||
List[
|
||||
Tuple[
|
||||
django.template.defaulttags.TemplateLiteral,
|
||||
django.template.base.NodeList,
|
||||
]
|
||||
],
|
||||
List[
|
||||
Tuple[django.template.base.NodeList, django.template.base.NodeList]
|
||||
],
|
||||
] = ...
|
||||
def __init__(
|
||||
self,
|
||||
conditions_nodelists: Union[
|
||||
List[Tuple[TemplateLiteral, NodeList]],
|
||||
List[Union[Tuple[TemplateLiteral, NodeList], Tuple[None, NodeList]]],
|
||||
List[Tuple[NodeList, NodeList]],
|
||||
],
|
||||
) -> None: ...
|
||||
def __repr__(self) -> str: ...
|
||||
def __iter__(self) -> None: ...
|
||||
@property
|
||||
def nodelist(self) -> NodeList: ...
|
||||
def render(self, context: Context) -> str: ...
|
||||
|
||||
class LoremNode(Node):
|
||||
def __init__(self, count: FilterExpression, method: str, common: bool) -> None: ...
|
||||
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):
|
||||
var_name: Any = ...
|
||||
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
|
||||
self,
|
||||
target: FilterExpression,
|
||||
expression: FilterExpression,
|
||||
var_name: str,
|
||||
) -> None: ...
|
||||
def resolve_expression(
|
||||
self, obj: Dict[str, Union[str, int, date, List[str]]], context: Context
|
||||
) -> Union[int, str]: ...
|
||||
self, obj: Dict[str, Union[str, int, List[str], date]], context: Context
|
||||
) -> Union[str, int]: ...
|
||||
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):
|
||||
format_string: Any = ...
|
||||
asvar: Any = ...
|
||||
def __init__(self, format_string: str, asvar: None = ...) -> None: ...
|
||||
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):
|
||||
node: Any = ...
|
||||
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):
|
||||
nodelist: Any = ...
|
||||
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: Any = ...
|
||||
tagtype: str = ...
|
||||
def __init__(self, tagtype: str) -> None: ...
|
||||
def render(self, context: Context) -> str: ...
|
||||
|
||||
class URLNode(Node):
|
||||
view_name: Any = ...
|
||||
args: Any = ...
|
||||
kwargs: Any = ...
|
||||
asvar: Any = ...
|
||||
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,
|
||||
@@ -185,15 +236,19 @@ class URLNode(Node):
|
||||
def render(self, context: Context) -> str: ...
|
||||
|
||||
class VerbatimNode(Node):
|
||||
content: Any = ...
|
||||
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):
|
||||
val_expr: Any = ...
|
||||
max_expr: Any = ...
|
||||
max_width: Any = ...
|
||||
asvar: Any = ...
|
||||
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,
|
||||
@@ -204,23 +259,26 @@ class WidthRatioNode(Node):
|
||||
def render(self, context: Context) -> str: ...
|
||||
|
||||
class WithNode(Node):
|
||||
nodelist: Any = ...
|
||||
extra_context: Any = ...
|
||||
origin: django.template.base.Origin
|
||||
token: django.template.base.Token
|
||||
nodelist: Union[django.template.base.NodeList, List[Any]] = ...
|
||||
extra_context: Dict[
|
||||
str, Union[django.template.base.FilterExpression, str]
|
||||
] = ...
|
||||
def __init__(
|
||||
self,
|
||||
var: None,
|
||||
name: None,
|
||||
nodelist: NodeList,
|
||||
extra_context: Dict[str, FilterExpression] = ...,
|
||||
var: Optional[str],
|
||||
name: Optional[str],
|
||||
nodelist: Union[NodeList, List[Any]],
|
||||
extra_context: Optional[Dict[str, FilterExpression]] = ...,
|
||||
) -> None: ...
|
||||
def __repr__(self): ...
|
||||
def render(self, context: Context): ...
|
||||
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: Any, token: Any): ...
|
||||
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: ...
|
||||
@@ -229,22 +287,27 @@ def ifequal(parser: Parser, token: Token) -> IfEqualNode: ...
|
||||
def ifnotequal(parser: Parser, token: Token) -> IfEqualNode: ...
|
||||
|
||||
class TemplateLiteral(Literal):
|
||||
value: Any = ...
|
||||
text: Any = ...
|
||||
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: 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_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: ...
|
||||
|
||||
@@ -1,43 +1,51 @@
|
||||
# Stubs for django.template.engine (Python 3.6)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
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
|
||||
from typing import Any, Optional
|
||||
|
||||
from django.template.base import Origin, Template
|
||||
from django.template.library import Library
|
||||
from django.template.loaders.base import Loader
|
||||
from django.template.loaders.cached import Loader
|
||||
from django.template.loaders.filesystem import Loader
|
||||
from django.template.loaders.locmem import Loader
|
||||
from django.utils.safestring import SafeText
|
||||
from typing import Any, Callable, Dict, List, Optional, Tuple, Union
|
||||
|
||||
class Engine:
|
||||
template_context_processors: Tuple[Callable]
|
||||
template_loaders: List[django.template.loaders.base.Loader]
|
||||
default_builtins: Any = ...
|
||||
dirs: Any = ...
|
||||
app_dirs: Any = ...
|
||||
autoescape: Any = ...
|
||||
context_processors: Any = ...
|
||||
debug: Any = ...
|
||||
loaders: Any = ...
|
||||
string_if_invalid: Any = ...
|
||||
file_charset: Any = ...
|
||||
libraries: Any = ...
|
||||
template_libraries: Any = ...
|
||||
builtins: Any = ...
|
||||
template_builtins: Any = ...
|
||||
dirs: List[str] = ...
|
||||
app_dirs: bool = ...
|
||||
autoescape: bool = ...
|
||||
context_processors: Union[Tuple[str], List[str]] = ...
|
||||
debug: bool = ...
|
||||
loaders: Union[
|
||||
List[List[Union[str, Dict[str, str]]]],
|
||||
List[Union[Tuple[str, Dict[str, str]], str]],
|
||||
List[Tuple[str, List[str]]],
|
||||
List[Tuple[str, List[Tuple[str, Dict[str, 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, str]]] = ...,
|
||||
context_processors: Optional[Union[Tuple[str], List[str]]] = ...,
|
||||
debug: bool = ...,
|
||||
loaders: Any = ...,
|
||||
loaders: Optional[
|
||||
Union[
|
||||
List[List[Union[str, Dict[str, str]]]],
|
||||
List[Union[Tuple[str, Dict[str, str]], str]],
|
||||
List[Tuple[str, List[str]]],
|
||||
List[Tuple[str, List[Tuple[str, Dict[str, str]]]]],
|
||||
]
|
||||
] = ...,
|
||||
string_if_invalid: str = ...,
|
||||
file_charset: str = ...,
|
||||
libraries: Optional[Dict[str, str]] = ...,
|
||||
@@ -46,25 +54,35 @@ class Engine:
|
||||
) -> None: ...
|
||||
@staticmethod
|
||||
def get_default() -> Engine: ...
|
||||
def template_context_processors(
|
||||
self
|
||||
) -> Union[
|
||||
Tuple[Callable, Callable, Callable],
|
||||
Tuple[Callable],
|
||||
Tuple[Callable, Callable, Callable, Callable, Callable],
|
||||
Tuple[Callable, Callable],
|
||||
]: ...
|
||||
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) -> Union[List[Loader], List[Loader], List[Loader]]: ...
|
||||
def get_template_loaders(self, template_loaders: Any) -> Any: ...
|
||||
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[Union[Tuple[str, Dict[str, str]], str]],
|
||||
List[List[Union[str, Dict[str, str]]]],
|
||||
List[Tuple[str, List[str]]],
|
||||
List[Tuple[str, List[Tuple[str, Dict[str, str]]]]],
|
||||
],
|
||||
) -> List[Loader]: ...
|
||||
def find_template_loader(
|
||||
self,
|
||||
loader: Union[
|
||||
Tuple[str, List[Tuple[str, Dict[str, str]]]],
|
||||
Tuple[str, List[str]],
|
||||
Tuple[str, Dict[str, str]],
|
||||
Tuple[
|
||||
str,
|
||||
Union[
|
||||
List[Tuple[str, Dict[str, str]]],
|
||||
Dict[str, str],
|
||||
List[Any],
|
||||
List[str],
|
||||
],
|
||||
],
|
||||
str,
|
||||
List[Union[str, Dict[str, str]]],
|
||||
],
|
||||
) -> Loader: ...
|
||||
def find_template(
|
||||
@@ -72,5 +90,7 @@ class Engine:
|
||||
) -> 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 render_to_string(
|
||||
self, template_name: str, context: Any = ...
|
||||
) -> SafeText: ...
|
||||
def select_template(self, template_name_list: List[str]) -> Template: ...
|
||||
|
||||
@@ -1,17 +1,13 @@
|
||||
# Stubs for django.template.exceptions (Python 3.6)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
|
||||
from typing import Any, Optional
|
||||
from typing import Any, List, Optional, Tuple, Union
|
||||
|
||||
from django.template.backends.base import BaseEngine
|
||||
from django.template.base import Origin
|
||||
from typing import List, Optional, Tuple, Union
|
||||
|
||||
|
||||
class TemplateDoesNotExist(Exception):
|
||||
backend: Any = ...
|
||||
tried: Any = ...
|
||||
chain: Any = ...
|
||||
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[str, Origin],
|
||||
|
||||
@@ -1,38 +1,35 @@
|
||||
# Stubs for django.template.library (Python 3.6)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
|
||||
from .base import Node, Template, token_kwargs
|
||||
from .exceptions import TemplateSyntaxError
|
||||
from typing import Any, Optional
|
||||
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 typing import Any, Callable, Dict, List, Optional, Tuple, Union
|
||||
|
||||
from .base import Node, Template, token_kwargs
|
||||
from .exceptions import TemplateSyntaxError
|
||||
|
||||
|
||||
class InvalidTemplateLibrary(Exception): ...
|
||||
|
||||
class Library:
|
||||
filters: Any = ...
|
||||
tags: Any = ...
|
||||
filters: Dict[str, Callable] = ...
|
||||
tags: Dict[str, Callable] = ...
|
||||
def __init__(self) -> None: ...
|
||||
def tag(
|
||||
self,
|
||||
name: Optional[Union[str, Callable]] = ...,
|
||||
compile_function: Optional[Union[str, Callable]] = ...,
|
||||
compile_function: Optional[Union[Callable, str]] = ...,
|
||||
) -> Callable: ...
|
||||
def tag_function(self, func: Callable) -> Callable: ...
|
||||
def filter(
|
||||
self,
|
||||
name: Optional[Union[str, Callable]] = ...,
|
||||
filter_func: Optional[Callable] = ...,
|
||||
**flags: Any,
|
||||
filter_func: Optional[Union[str, Callable]] = ...,
|
||||
**flags: Any
|
||||
) -> Callable: ...
|
||||
def filter_function(self, func: Callable, **flags: Any) -> Callable: ...
|
||||
def simple_tag(
|
||||
self,
|
||||
func: Optional[Callable] = ...,
|
||||
func: Optional[Union[str, Callable]] = ...,
|
||||
takes_context: Optional[bool] = ...,
|
||||
name: Optional[str] = ...,
|
||||
) -> Callable: ...
|
||||
@@ -54,12 +51,29 @@ class TagHelperNode(Node):
|
||||
func: Callable,
|
||||
takes_context: Optional[bool],
|
||||
args: List[FilterExpression],
|
||||
kwargs: Dict[Any, Any],
|
||||
kwargs: Dict[str, FilterExpression],
|
||||
) -> None: ...
|
||||
def get_resolved_arguments(self, context: Context) -> Any: ...
|
||||
def get_resolved_arguments(
|
||||
self, context: Context
|
||||
) -> Union[
|
||||
Tuple[
|
||||
Union[Dict[str, int], Dict[str, Union[int, SafeText]]],
|
||||
Union[Dict[str, int], Dict[str, Union[int, SafeText]]],
|
||||
],
|
||||
Tuple[
|
||||
Union[Dict[Any, Any], Dict[str, SafeText]],
|
||||
Union[Dict[Any, Any], Dict[str, SafeText]],
|
||||
],
|
||||
]: ...
|
||||
|
||||
class SimpleNode(TagHelperNode):
|
||||
target_var: Any = ...
|
||||
args: List[django.template.base.FilterExpression]
|
||||
func: Callable
|
||||
kwargs: Dict[str, django.template.base.FilterExpression]
|
||||
origin: django.template.base.Origin
|
||||
takes_context: Optional[bool]
|
||||
token: django.template.base.Token
|
||||
target_var: Optional[str] = ...
|
||||
def __init__(
|
||||
self,
|
||||
func: Callable,
|
||||
@@ -71,13 +85,19 @@ class SimpleNode(TagHelperNode):
|
||||
def render(self, context: Context) -> str: ...
|
||||
|
||||
class InclusionNode(TagHelperNode):
|
||||
filename: Any = ...
|
||||
args: List[django.template.base.FilterExpression]
|
||||
func: Callable
|
||||
kwargs: Dict[str, django.template.base.FilterExpression]
|
||||
origin: django.template.base.Origin
|
||||
takes_context: Optional[bool]
|
||||
token: django.template.base.Token
|
||||
filename: Union[str, django.template.base.Template] = ...
|
||||
def __init__(
|
||||
self,
|
||||
func: Callable,
|
||||
takes_context: Optional[bool],
|
||||
args: List[FilterExpression],
|
||||
kwargs: Dict[Any, Any],
|
||||
kwargs: Dict[str, FilterExpression],
|
||||
filename: Optional[Union[str, Template]],
|
||||
) -> None: ...
|
||||
def render(self, context: Context) -> SafeText: ...
|
||||
@@ -87,16 +107,11 @@ def parse_bits(
|
||||
bits: List[str],
|
||||
params: List[str],
|
||||
varargs: Optional[str],
|
||||
varkw: None,
|
||||
varkw: Optional[str],
|
||||
defaults: Optional[Union[Tuple[bool, None], Tuple[str]]],
|
||||
kwonly: List[str],
|
||||
kwonly_defaults: Optional[Dict[str, int]],
|
||||
takes_context: Optional[bool],
|
||||
name: str,
|
||||
) -> Union[
|
||||
Tuple[List[Any], Dict[Any, Any]],
|
||||
Tuple[List[FilterExpression], Dict[str, FilterExpression]],
|
||||
Tuple[List[Any], Dict[str, FilterExpression]],
|
||||
Tuple[List[FilterExpression], Dict[Any, Any]],
|
||||
]: ...
|
||||
) -> Tuple[List[FilterExpression], Dict[str, FilterExpression]]: ...
|
||||
def import_library(name: str) -> Library: ...
|
||||
|
||||
@@ -1,23 +1,22 @@
|
||||
# Stubs for django.template.loader (Python 3.6)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
|
||||
from .exceptions import TemplateDoesNotExist
|
||||
from typing import Any, Optional
|
||||
|
||||
from django.core.handlers.wsgi import WSGIRequest
|
||||
from django.template.backends.base import BaseEngine
|
||||
from django.template.backends.django import DjangoTemplates, Template
|
||||
from typing import Any, List, Optional, Union
|
||||
|
||||
def get_template(template_name: str, using: None = ...) -> Template: ...
|
||||
def select_template(template_name_list: List[str], using: None = ...) -> Template: ...
|
||||
from django.core.handlers.wsgi import WSGIRequest
|
||||
from django.template.backends.django import Template
|
||||
from django.template.backends.dummy import Template
|
||||
from django.template.backends.jinja2 import Template
|
||||
|
||||
from .exceptions import TemplateDoesNotExist
|
||||
|
||||
|
||||
def get_template(
|
||||
template_name: str, using: Optional[str] = ...
|
||||
) -> Union[Template, Template, Template]: ...
|
||||
def select_template(
|
||||
template_name_list: Union[str, List[str]], using: Optional[str] = ...
|
||||
) -> Union[Template, Template, Template]: ...
|
||||
def render_to_string(
|
||||
template_name: Union[str, List[str]],
|
||||
context: Any = ...,
|
||||
request: Optional[WSGIRequest] = ...,
|
||||
using: Optional[str] = ...,
|
||||
) -> str: ...
|
||||
def _engine_list(
|
||||
using: Optional[str] = ...
|
||||
) -> Union[List[BaseEngine], List[DjangoTemplates]]: ...
|
||||
|
||||
@@ -1,21 +1,19 @@
|
||||
# Stubs for django.template.loader_tags (Python 3.6)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
from typing import Any, Dict, List, Optional, Union
|
||||
|
||||
from .base import Node, Template, TemplateSyntaxError, TextNode, Variable, token_kwargs
|
||||
from .library import Library
|
||||
from typing import Any, Optional
|
||||
|
||||
from django.template.base import FilterExpression, NodeList, Parser, Template, Token
|
||||
from django.template.base import (FilterExpression, Node, NodeList, Parser,
|
||||
Template, Token)
|
||||
from django.template.context import Context
|
||||
from django.utils.safestring import SafeText
|
||||
from typing import Dict, Optional
|
||||
|
||||
from .base import (Node, Template, TemplateSyntaxError, TextNode, Variable,
|
||||
token_kwargs)
|
||||
from .library import Library
|
||||
|
||||
register: Any
|
||||
BLOCK_CONTEXT_KEY: str
|
||||
|
||||
class BlockContext:
|
||||
blocks: Any = ...
|
||||
blocks: collections.defaultdict = ...
|
||||
def __init__(self) -> None: ...
|
||||
def add_blocks(self, blocks: Dict[str, BlockNode]) -> None: ...
|
||||
def pop(self, name: str) -> BlockNode: ...
|
||||
@@ -23,38 +21,55 @@ class BlockContext:
|
||||
def get_block(self, name: str) -> BlockNode: ...
|
||||
|
||||
class BlockNode(Node):
|
||||
def __init__(self, name: str, nodelist: NodeList, parent: None = ...) -> None: ...
|
||||
def __repr__(self) -> str: ...
|
||||
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: Any = ...
|
||||
parent_name: Any = ...
|
||||
template_dirs: Any = ...
|
||||
blocks: Any = ...
|
||||
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: FilterExpression, template_dirs: None = ...
|
||||
self,
|
||||
nodelist: NodeList,
|
||||
parent_name: Union[FilterExpression, Node],
|
||||
template_dirs: Optional[List[Any]] = ...,
|
||||
) -> None: ...
|
||||
def __repr__(self) -> str: ...
|
||||
def find_template(self, template_name: str, context: Context) -> Template: ...
|
||||
def find_template(
|
||||
self, template_name: str, context: Context
|
||||
) -> Template: ...
|
||||
def get_parent(self, context: Context) -> Template: ...
|
||||
def render(self, context: Context): ...
|
||||
def render(self, context: Context) -> Any: ...
|
||||
|
||||
class IncludeNode(Node):
|
||||
origin: django.template.base.Origin
|
||||
token: django.template.base.Token
|
||||
context_key: str = ...
|
||||
template: Any = ...
|
||||
extra_context: Any = ...
|
||||
isolated_context: Any = ...
|
||||
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,
|
||||
**kwargs: Any
|
||||
) -> None: ...
|
||||
def render(self, context: Context) -> SafeText: ...
|
||||
|
||||
|
||||
@@ -1,14 +1,9 @@
|
||||
# Stubs for django.template.loaders.app_directories (Python 3.6)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
from typing import Optional, Tuple
|
||||
|
||||
from .filesystem import Loader as FilesystemLoader
|
||||
|
||||
from typing import Tuple, Union
|
||||
|
||||
class Loader(FilesystemLoader):
|
||||
def get_dirs(
|
||||
self
|
||||
) -> Union[
|
||||
Tuple[str, str], Tuple[str, str, str], Tuple[str], Tuple[str, str, str, str]
|
||||
]: ...
|
||||
dirs: None
|
||||
engine: django.template.engine.Engine
|
||||
def get_dirs(self) -> Tuple: ...
|
||||
|
||||
@@ -1,12 +1,8 @@
|
||||
# Stubs for django.template.loaders.base (Python 3.6)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
|
||||
from typing import Any, Optional
|
||||
from typing import Any, List, Optional
|
||||
|
||||
from django.template.base import Origin, Template
|
||||
from django.template.engine import Engine
|
||||
from typing import List, Optional
|
||||
|
||||
|
||||
class Loader:
|
||||
engine: Any = ...
|
||||
|
||||
@@ -1,26 +1,35 @@
|
||||
# Stubs for django.template.loaders.cached (Python 3.6)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
|
||||
from .base import Loader as BaseLoader
|
||||
from typing import Any, Optional
|
||||
from typing import Any, Dict, List, Optional, Tuple, Union
|
||||
|
||||
from django.template.base import Origin, Template
|
||||
from django.template.engine import Engine
|
||||
from typing import Dict, List, Optional, Tuple, Union
|
||||
|
||||
from .base import Loader as BaseLoader
|
||||
|
||||
|
||||
class Loader(BaseLoader):
|
||||
template_cache: Any = ...
|
||||
get_template_cache: Any = ...
|
||||
loaders: Any = ...
|
||||
engine: django.template.engine.Engine
|
||||
template_cache: Dict[Any, Any] = ...
|
||||
get_template_cache: Dict[
|
||||
str,
|
||||
Union[
|
||||
django.template.base.Template,
|
||||
Type[django.template.exceptions.TemplateDoesNotExist],
|
||||
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]]
|
||||
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 cache_key(
|
||||
self, template_name: str, skip: Optional[List[Origin]] = ...
|
||||
) -> str: ...
|
||||
def generate_hash(self, values: List[str]) -> str: ...
|
||||
def reset(self) -> None: ...
|
||||
|
||||
@@ -1,19 +1,19 @@
|
||||
# Stubs for django.template.loaders.filesystem (Python 3.6)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
|
||||
from .base import Loader as BaseLoader
|
||||
from typing import Any, Optional
|
||||
from typing import Any, Iterator, List, Optional, Union
|
||||
|
||||
from django.template.base import Origin
|
||||
from django.template.engine import Engine
|
||||
from typing import Iterator, List, Union
|
||||
|
||||
from .base import Loader as BaseLoader
|
||||
|
||||
|
||||
class Loader(BaseLoader):
|
||||
dirs: Any = ...
|
||||
def __init__(self, engine: Engine, dirs: None = ...) -> None: ...
|
||||
def get_dirs(self) -> List[str]: ...
|
||||
def get_contents(self, origin: Origin): ...
|
||||
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]
|
||||
self, template_name: Union[str, bytes]
|
||||
) -> Iterator[Origin]: ...
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
# Stubs for django.template.loaders.locmem (Python 3.6)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
|
||||
from .base import Loader as BaseLoader
|
||||
from typing import Any
|
||||
from typing import Any, Dict, Iterator, Optional
|
||||
|
||||
from django.template.base import Origin
|
||||
from django.template.engine import Engine
|
||||
from typing import Dict, Iterator
|
||||
|
||||
from .base import Loader as BaseLoader
|
||||
|
||||
|
||||
class Loader(BaseLoader):
|
||||
templates_dict: Any = ...
|
||||
def __init__(self, engine: Engine, templates_dict: Dict[str, str]) -> None: ...
|
||||
engine: django.template.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]: ...
|
||||
|
||||
@@ -1,43 +1,47 @@
|
||||
# Stubs for django.template.response (Python 3.6)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
from http.cookies import SimpleCookie
|
||||
from typing import Any, Callable, Dict, List, Optional, Tuple, Union
|
||||
|
||||
from .loader import get_template, select_template
|
||||
from django.http import HttpResponse
|
||||
from typing import Any, Optional
|
||||
|
||||
from django.http.request import HttpRequest
|
||||
from django.template.backends.django import Template
|
||||
from django.template.backends.jinja2 import Template
|
||||
from django.utils.safestring import SafeText
|
||||
from typing import Any, Callable, Dict, List, Optional, Union
|
||||
|
||||
from .loader import get_template, select_template
|
||||
|
||||
|
||||
class ContentNotRenderedError(Exception): ...
|
||||
|
||||
class SimpleTemplateResponse(HttpResponse):
|
||||
closed: bool
|
||||
cookies: http.cookies.SimpleCookie
|
||||
status_code: int
|
||||
rendering_attrs: Any = ...
|
||||
template_name: Any = ...
|
||||
context_data: Any = ...
|
||||
using: Any = ...
|
||||
_post_render_callbacks: Any = ...
|
||||
_request: Any = ...
|
||||
_is_rendered: bool = ...
|
||||
template_name: Union[
|
||||
str, django.template.backends.django.Template, List[str]
|
||||
] = ...
|
||||
context_data: Optional[
|
||||
Union[Dict[str, str], Dict[str, Union[int, Callable]]]
|
||||
] = ...
|
||||
using: Optional[str] = ...
|
||||
def __init__(
|
||||
self,
|
||||
template: Union[str, List[str], Template],
|
||||
template: Union[str, Template, List[str]],
|
||||
context: Any = ...,
|
||||
content_type: Optional[str] = ...,
|
||||
status: Optional[int] = ...,
|
||||
charset: Optional[str] = ...,
|
||||
using: None = ...,
|
||||
charset: None = ...,
|
||||
using: Optional[str] = ...,
|
||||
) -> None: ...
|
||||
def __getstate__(self) -> Dict[str, Any]: ...
|
||||
def resolve_template(self, template: Union[str, List[str], Template]) -> Template: ...
|
||||
def resolve_template(
|
||||
self, template: Union[str, List[str]]
|
||||
) -> Union[Template, Template]: ...
|
||||
def resolve_context(self, context: Any) -> Any: ...
|
||||
@property
|
||||
def rendered_content(self) -> SafeText: ...
|
||||
def add_post_render_callback(self, callback: Callable) -> None: ...
|
||||
content: Any = ...
|
||||
def render(self) -> SimpleTemplateResponse: ...
|
||||
def render(self) -> TemplateResponse: ...
|
||||
@property
|
||||
def is_rendered(self) -> bool: ...
|
||||
def __iter__(self): ...
|
||||
@@ -47,15 +51,31 @@ class SimpleTemplateResponse(HttpResponse):
|
||||
def content(self, value: Any) -> None: ...
|
||||
|
||||
class TemplateResponse(SimpleTemplateResponse):
|
||||
client: django.test.client.Client
|
||||
closed: bool
|
||||
context: django.template.context.RequestContext
|
||||
context_data: Any
|
||||
cookies: http.cookies.SimpleCookie
|
||||
csrf_cookie_set: bool
|
||||
json: functools.partial
|
||||
redirect_chain: List[Tuple[str, int]]
|
||||
request: Dict[str, str]
|
||||
resolver_match: django.utils.functional.SimpleLazyObject
|
||||
status_code: int
|
||||
template_name: Union[
|
||||
str, django.template.backends.django.Template, List[str]
|
||||
]
|
||||
templates: List[django.template.base.Template]
|
||||
using: Optional[str]
|
||||
wsgi_request: django.core.handlers.wsgi.WSGIRequest
|
||||
rendering_attrs: Any = ...
|
||||
_request: Any = ...
|
||||
def __init__(
|
||||
self,
|
||||
request: HttpRequest,
|
||||
template: Union[str, List[str], Template],
|
||||
template: Union[str, Template, List[str]],
|
||||
context: Any = ...,
|
||||
content_type: Optional[str] = ...,
|
||||
status: Optional[int] = ...,
|
||||
charset: None = ...,
|
||||
using: None = ...,
|
||||
using: Optional[str] = ...,
|
||||
) -> None: ...
|
||||
|
||||
@@ -1,11 +1,7 @@
|
||||
# Stubs for django.template.smartif (Python 3.6)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
|
||||
from typing import Any
|
||||
from typing import Any, Dict, List, Optional, Union
|
||||
|
||||
from django.template.defaulttags import TemplateLiteral
|
||||
from typing import Any, Dict, List, Optional, Union
|
||||
|
||||
|
||||
class TokenBase:
|
||||
id: Any = ...
|
||||
@@ -15,7 +11,6 @@ class TokenBase:
|
||||
def nud(self, parser: Any) -> None: ...
|
||||
def led(self, left: Any, parser: Any) -> None: ...
|
||||
def display(self): ...
|
||||
def __repr__(self): ...
|
||||
|
||||
def infix(bp: Any, func: Any): ...
|
||||
def prefix(bp: Any, func: Any): ...
|
||||
@@ -25,12 +20,13 @@ OPERATORS: Any
|
||||
class Literal(TokenBase):
|
||||
id: str = ...
|
||||
lbp: int = ...
|
||||
value: Any = ...
|
||||
def __init__(self, value: Optional[int]) -> None: ...
|
||||
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]]: ...
|
||||
def __repr__(self) -> str: ...
|
||||
def eval(
|
||||
self, context: Dict[Any, Any]
|
||||
) -> Optional[Union[List[int], int]]: ...
|
||||
|
||||
class EndToken(TokenBase):
|
||||
lbp: int = ...
|
||||
@@ -41,8 +37,17 @@ class IfParser:
|
||||
tokens: Any = ...
|
||||
pos: int = ...
|
||||
current_token: Any = ...
|
||||
def __init__(self, tokens: Any) -> None: ...
|
||||
def translate_token(self, token: Union[str, List[int], int]) -> Literal: ...
|
||||
def __init__(
|
||||
self,
|
||||
tokens: Union[
|
||||
List[Union[int, str, List[int]]],
|
||||
List[Union[None, str, List[int]]],
|
||||
List[Union[int, str, None]],
|
||||
],
|
||||
) -> 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: ...
|
||||
|
||||
@@ -1,27 +1,20 @@
|
||||
# Stubs for django.template.utils (Python 3.6)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
from collections import OrderedDict
|
||||
from typing import Any, Dict, List, Optional, Tuple, Union
|
||||
|
||||
from django.core.exceptions import ImproperlyConfigured
|
||||
from typing import Any, Optional
|
||||
|
||||
from collections import OrderedDict
|
||||
from django.template.backends.base import BaseEngine
|
||||
from django.template.backends.django import DjangoTemplates
|
||||
from django.template.backends.dummy import TemplateStrings
|
||||
from typing import List, Tuple, Union
|
||||
|
||||
|
||||
class InvalidTemplateEngineError(ImproperlyConfigured): ...
|
||||
|
||||
class EngineHandler:
|
||||
_templates: Any = ...
|
||||
_engines: Any = ...
|
||||
def __init__(self, templates: Optional[Any] = ...) -> None: ...
|
||||
templates: collections.OrderedDict
|
||||
def __init__(
|
||||
self, templates: List[Dict[str, Union[str, Dict[str, bool]]]] = ...
|
||||
) -> None: ...
|
||||
def templates(self) -> OrderedDict: ...
|
||||
def __getitem__(self, alias: str) -> BaseEngine: ...
|
||||
def __iter__(self): ...
|
||||
def all(
|
||||
self
|
||||
) -> Union[List[BaseEngine], List[TemplateStrings], List[DjangoTemplates]]: ...
|
||||
def __iter__(self) -> Any: ...
|
||||
def all(self) -> List[BaseEngine]: ...
|
||||
|
||||
def get_app_template_dirs(dirname: str) -> Tuple: ...
|
||||
|
||||
Reference in New Issue
Block a user