mirror of
https://github.com/davidhalter/django-stubs.git
synced 2026-10-23 06:17:09 +08:00
merge with stubgen output
This commit is contained in:
1 parent
496a6274e7
commit
4866354600
294 files changed
+10234
-10842
No files matched your search
@@ -1,14 +1,18 @@
|
||||
from typing import (
|
||||
Dict,
|
||||
Iterator,
|
||||
List,
|
||||
Tuple,
|
||||
Union,
|
||||
)
|
||||
# Stubs for django.template.backends.base (Python 3.6)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
|
||||
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: ...
|
||||
@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 iter_template_filenames(self, template_name: str) -> Iterator[str]: ...
|
||||
@cached_property
|
||||
def template_dirs(self) -> Tuple: ...
|
||||
@@ -1,48 +1,32 @@
|
||||
# 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,
|
||||
)
|
||||
|
||||
|
||||
def copy_exception(
|
||||
exc: TemplateDoesNotExist,
|
||||
backend: Optional[DjangoTemplates] = ...
|
||||
) -> TemplateDoesNotExist: ...
|
||||
|
||||
|
||||
def get_installed_libraries() -> Dict[str, str]: ...
|
||||
|
||||
|
||||
def get_package_libraries(pkg: Any) -> Iterator[str]: ...
|
||||
|
||||
|
||||
def reraise(
|
||||
exc: TemplateDoesNotExist,
|
||||
backend: DjangoTemplates
|
||||
): ...
|
||||
|
||||
|
||||
class DjangoTemplates:
|
||||
from typing import Any, Dict, Iterator, Optional
|
||||
class DjangoTemplates(BaseEngine):
|
||||
app_dirname: str = ...
|
||||
engine: Any = ...
|
||||
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:
|
||||
def __init__(
|
||||
self,
|
||||
template: Template,
|
||||
backend: DjangoTemplates
|
||||
) -> None: ...
|
||||
def render(
|
||||
self,
|
||||
context: Any = ...,
|
||||
request: Optional[HttpRequest] = ...
|
||||
) -> SafeText: ...
|
||||
template: Any = ...
|
||||
backend: Any = ...
|
||||
def __init__(self, template: Template, backend: DjangoTemplates) -> None: ...
|
||||
@property
|
||||
def origin(self): ...
|
||||
def render(self, context: Any = ..., request: Optional[HttpRequest] = ...) -> SafeText: ...
|
||||
|
||||
def copy_exception(exc: TemplateDoesNotExist, backend: Optional[DjangoTemplates] = ...) -> TemplateDoesNotExist: ...
|
||||
def reraise(exc: TemplateDoesNotExist, backend: DjangoTemplates) -> None: ...
|
||||
def get_installed_libraries() -> Dict[str, str]: ...
|
||||
def get_package_libraries(pkg: Any) -> Iterator[str]: ...
|
||||
@@ -1,19 +1,19 @@
|
||||
# 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 django.http.request import HttpRequest
|
||||
from typing import (
|
||||
Dict,
|
||||
Optional,
|
||||
Union,
|
||||
)
|
||||
|
||||
|
||||
class Template:
|
||||
def render(
|
||||
self,
|
||||
context: Optional[Dict[str, str]] = ...,
|
||||
request: Optional[HttpRequest] = ...
|
||||
) -> str: ...
|
||||
|
||||
|
||||
class TemplateStrings:
|
||||
from typing import Dict, Optional, Union
|
||||
class TemplateStrings(BaseEngine):
|
||||
app_dirname: str = ...
|
||||
def __init__(self, params: Dict[str, Union[bool, str]]) -> None: ...
|
||||
def get_template(self, template_name: str) -> Template: ...
|
||||
def from_string(self, template_code: Any): ...
|
||||
def get_template(self, template_name: str) -> Template: ...
|
||||
|
||||
class Template(string.Template):
|
||||
def render(self, context: Optional[Dict[str, str]] = ..., request: Optional[HttpRequest] = ...) -> str: ...
|
||||
@@ -1,5 +1,12 @@
|
||||
# Stubs for django.template.backends.utils (Python 3.6)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
|
||||
from typing import Any
|
||||
|
||||
from django.http.request import HttpRequest
|
||||
from django.utils.safestring import SafeText
|
||||
def csrf_input(request: HttpRequest) -> SafeText: ...
|
||||
|
||||
|
||||
def csrf_input(request: HttpRequest) -> SafeText: ...
|
||||
csrf_input_lazy: Any
|
||||
csrf_token_lazy: Any
|
||||
+133
-153
@@ -1,186 +1,166 @@
|
||||
# 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 django.template.backends.dummy import TemplateStrings
|
||||
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.loader_tags import BlockNode, ExtendsNode
|
||||
from django.template.loaders.base import Loader
|
||||
from django.utils.safestring import SafeText
|
||||
from typing import (
|
||||
Any,
|
||||
Callable,
|
||||
Dict,
|
||||
Iterator,
|
||||
List,
|
||||
Optional,
|
||||
Tuple,
|
||||
Type,
|
||||
Union,
|
||||
)
|
||||
from typing import Any, Callable, Dict, Iterator, List, Optional, Tuple, Type, Union
|
||||
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 = ...
|
||||
|
||||
def linebreak_iter(template_source: str) -> Iterator[int]: ...
|
||||
|
||||
|
||||
def render_value_in_context(value: object, context: Context) -> str: ...
|
||||
|
||||
|
||||
def token_kwargs(
|
||||
bits: List[str],
|
||||
parser: Parser,
|
||||
support_legacy: bool = ...
|
||||
) -> Dict[str, FilterExpression]: ...
|
||||
|
||||
|
||||
class DebugLexer:
|
||||
def tokenize(self) -> List[Token]: ...
|
||||
|
||||
|
||||
class FilterExpression:
|
||||
def __init__(self, token: str, parser: Parser) -> None: ...
|
||||
class VariableDoesNotExist(Exception):
|
||||
msg: Any = ...
|
||||
params: Any = ...
|
||||
def __init__(self, msg: str, params: Any = ...) -> None: ...
|
||||
def __str__(self) -> str: ...
|
||||
@staticmethod
|
||||
def args_check(
|
||||
name: str,
|
||||
func: Callable,
|
||||
provided: Union[List[Tuple[bool, SafeText]], List[Tuple[bool, Variable]]]
|
||||
) -> bool: ...
|
||||
def resolve(
|
||||
self,
|
||||
context: Union[Dict[str, Dict[str, str]], Context],
|
||||
ignore_failures: bool = ...
|
||||
) -> object: ...
|
||||
|
||||
|
||||
class Lexer:
|
||||
def __init__(self, template_string: str) -> None: ...
|
||||
def create_token(
|
||||
self,
|
||||
token_string: str,
|
||||
position: Optional[Tuple[int, int]],
|
||||
lineno: int,
|
||||
in_tag: bool
|
||||
) -> Token: ...
|
||||
def tokenize(self) -> List[Token]: ...
|
||||
|
||||
|
||||
class Node:
|
||||
def get_nodes_by_type(
|
||||
self,
|
||||
nodetype: Type[Node]
|
||||
) -> Union[List[LoadNode], List[VariableNode], List[BlockNode], List[ExtendsNode]]: ...
|
||||
def render_annotated(self, context: Context) -> Union[int, str]: ...
|
||||
|
||||
|
||||
class NodeList:
|
||||
def get_nodes_by_type(
|
||||
self,
|
||||
nodetype: Type[Node]
|
||||
) -> Union[List[BlockNode], List[VariableNode]]: ...
|
||||
def render(self, context: Context) -> SafeText: ...
|
||||
|
||||
|
||||
class Origin:
|
||||
name: Any = ...
|
||||
template_name: Any = ...
|
||||
loader: Any = ...
|
||||
def __init__(self, name: str, template_name: Optional[str] = ..., loader: Optional[Union[Loader, TemplateStrings]] = ...) -> None: ...
|
||||
def __str__(self): ...
|
||||
def __eq__(self, other: Origin) -> bool: ...
|
||||
def __init__(
|
||||
self,
|
||||
name: str,
|
||||
template_name: Optional[str] = ...,
|
||||
loader: Optional[Union[Loader, TemplateStrings]] = ...
|
||||
) -> None: ...
|
||||
@property
|
||||
def loader_name(self) -> Optional[str]: ...
|
||||
|
||||
class Template:
|
||||
name: Any = ...
|
||||
origin: Any = ...
|
||||
engine: Any = ...
|
||||
source: Any = ...
|
||||
nodelist: Any = ...
|
||||
def __init__(self, template_string: str, origin: Optional[Origin] = ..., name: Optional[str] = ..., engine: Optional[Engine] = ...) -> None: ...
|
||||
def __iter__(self) -> None: ...
|
||||
def _render(self, context: Any): ...
|
||||
def render(self, context: Context): ...
|
||||
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]: ...
|
||||
|
||||
class Token:
|
||||
lineno: Any = ...
|
||||
position: Any = ...
|
||||
def __init__(self, token_type: TokenType, contents: str, position: Optional[Tuple[int, int]] = ..., lineno: Optional[int] = ...) -> None: ...
|
||||
def __str__(self): ...
|
||||
def split_contents(self) -> List[str]: ...
|
||||
|
||||
class Lexer:
|
||||
template_string: Any = ...
|
||||
verbatim: bool = ...
|
||||
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):
|
||||
def tokenize(self) -> List[Token]: ...
|
||||
|
||||
class Parser:
|
||||
def __init__(
|
||||
self,
|
||||
tokens: Union[str, List[Token]],
|
||||
libraries: Optional[Dict[str, Library]] = ...,
|
||||
builtins: List[Library] = ...,
|
||||
origin: Optional[Origin] = ...
|
||||
) -> None: ...
|
||||
tokens: Any = ...
|
||||
tags: Any = ...
|
||||
filters: Any = ...
|
||||
command_stack: Any = ...
|
||||
libraries: Any = ...
|
||||
origin: Any = ...
|
||||
def __init__(self, tokens: Union[str, List[Token]], libraries: Optional[Dict[str, Library]] = ..., builtins: List[Library] = ..., origin: Optional[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 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]]) -> None: ...
|
||||
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 delete_first_token(self) -> None: ...
|
||||
def error(
|
||||
self,
|
||||
token: Token,
|
||||
e: Union[str, RuntimeError, TemplateSyntaxError]
|
||||
) -> Union[RuntimeError, TemplateSyntaxError]: ...
|
||||
def extend_nodelist(
|
||||
self,
|
||||
nodelist: NodeList,
|
||||
node: Node,
|
||||
token: Token
|
||||
) -> None: ...
|
||||
def find_filter(self, filter_name: str) -> Callable: ...
|
||||
def invalid_block_tag(
|
||||
self,
|
||||
token: Token,
|
||||
command: str,
|
||||
parse_until: Union[Tuple[str], Tuple[str, str]] = ...
|
||||
): ...
|
||||
def next_token(self) -> Token: ...
|
||||
def parse(
|
||||
self,
|
||||
parse_until: Optional[Union[Tuple[str, str], Tuple[str], Tuple[str, str, str]]] = ...
|
||||
) -> NodeList: ...
|
||||
def prepend_token(self, token: Token) -> None: ...
|
||||
def skip_past(self, endtag: str) -> None: ...
|
||||
def unclosed_block_tag(self, parse_until: Union[Tuple[str], Tuple[str, str, str]]): ...
|
||||
|
||||
constant_string: Any
|
||||
filter_raw_string: Any
|
||||
filter_re: Any
|
||||
|
||||
class Template:
|
||||
def __init__(
|
||||
self,
|
||||
template_string: str,
|
||||
origin: Optional[Origin] = ...,
|
||||
name: Optional[str] = ...,
|
||||
engine: Optional[Engine] = ...
|
||||
) -> None: ...
|
||||
def compile_nodelist(self) -> NodeList: ...
|
||||
def get_exception_info(
|
||||
self,
|
||||
exception: Exception,
|
||||
token: Token
|
||||
) -> Dict[str, Union[str, List[Tuple[int, SafeText]], int]]: ...
|
||||
def render(self, context: Context): ...
|
||||
class FilterExpression:
|
||||
token: Any = ...
|
||||
filters: Any = ...
|
||||
var: Any = ...
|
||||
def __init__(self, token: str, parser: Parser) -> None: ...
|
||||
def resolve(self, context: Union[Dict[str, Dict[str, str]], Context], ignore_failures: bool = ...) -> object: ...
|
||||
def args_check(name: str, func: Callable, provided: Union[List[Tuple[bool, SafeText]], List[Tuple[bool, Variable]]]) -> bool: ...
|
||||
args_check: Any = ...
|
||||
def __str__(self) -> str: ...
|
||||
|
||||
class Variable:
|
||||
var: Any = ...
|
||||
literal: Any = ...
|
||||
lookups: Any = ...
|
||||
translate: bool = ...
|
||||
message_context: Any = ...
|
||||
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: ...
|
||||
|
||||
class TextNode:
|
||||
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]) -> Union[List[LoadNode], List[VariableNode], List[BlockNode], List[ExtendsNode]]: ...
|
||||
|
||||
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]]: ...
|
||||
|
||||
class TextNode(Node):
|
||||
s: Any = ...
|
||||
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: ...
|
||||
|
||||
class Token:
|
||||
def __init__(
|
||||
self,
|
||||
token_type: TokenType,
|
||||
contents: str,
|
||||
position: Optional[Tuple[int, int]] = ...,
|
||||
lineno: Optional[int] = ...
|
||||
) -> None: ...
|
||||
def split_contents(self) -> List[str]: ...
|
||||
|
||||
|
||||
class Variable:
|
||||
def __init__(self, var: str) -> None: ...
|
||||
def _resolve_lookup(self, context: Any) -> object: ...
|
||||
def resolve(self, context: Any) -> object: ...
|
||||
|
||||
|
||||
class VariableDoesNotExist:
|
||||
def __init__(self, msg: str, params: Any = ...) -> None: ...
|
||||
def __str__(self) -> str: ...
|
||||
|
||||
|
||||
class VariableNode:
|
||||
class VariableNode(Node):
|
||||
filter_expression: Any = ...
|
||||
def __init__(self, filter_expression: FilterExpression) -> None: ...
|
||||
def __repr__(self) -> str: ...
|
||||
def render(self, context: Context) -> str: ...
|
||||
def render(self, context: Context) -> str: ...
|
||||
|
||||
kwarg_re: Any
|
||||
|
||||
def token_kwargs(bits: List[str], parser: Parser, support_legacy: bool = ...) -> Dict[str, FilterExpression]: ...
|
||||
@@ -1,107 +1,75 @@
|
||||
# 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.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, Callable, Dict, Iterator, List, Optional, Type, Union
|
||||
_builtin_context_processors: Any
|
||||
|
||||
class ContextPopException(Exception): ...
|
||||
|
||||
def make_context(
|
||||
context: Any,
|
||||
request: Optional[WSGIRequest] = ...,
|
||||
**kwargs
|
||||
) -> Context: ...
|
||||
|
||||
class ContextDict(dict):
|
||||
context: Any = ...
|
||||
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 __contains__(self, key: str) -> bool: ...
|
||||
def __copy__(self) -> BaseContext: ...
|
||||
def __eq__(self, other: Context) -> bool: ...
|
||||
def __getitem__(self, key: Union[str, int]) -> object: ...
|
||||
def __init__(self, dict_: Any = ...) -> None: ...
|
||||
def __iter__(self) -> None: ...
|
||||
def __repr__(self) -> str: ...
|
||||
def __setitem__(
|
||||
self,
|
||||
key: Union[str, CycleNode, InclusionNode],
|
||||
value: Any
|
||||
) -> None: ...
|
||||
dicts: Any = ...
|
||||
def _reset_dicts(self, value: Any = ...) -> None: ...
|
||||
def flatten(self) -> Dict[str, Optional[Union[int, str, Dict[str, Union[Type[object], str]]]]]: ...
|
||||
def get(
|
||||
self,
|
||||
key: str,
|
||||
otherwise: Optional[int] = ...
|
||||
) -> Optional[Union[Options, int, str]]: ...
|
||||
def new(self, values: Any = ...) -> Context: ...
|
||||
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 push(self, *args, **kwargs) -> ContextDict: ...
|
||||
def __setitem__(self, key: Union[str, CycleNode, InclusionNode], value: Any) -> None: ...
|
||||
def set_upward(self, key: str, value: Union[str, int]) -> None: ...
|
||||
def setdefault(
|
||||
self,
|
||||
key: str,
|
||||
default: Union[List[Origin], int] = ...
|
||||
) -> Union[List[Origin], int]: ...
|
||||
def __getitem__(self, key: Union[str, int]) -> object: ...
|
||||
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: 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: ...
|
||||
|
||||
|
||||
class Context:
|
||||
def __copy__(self) -> Context: ...
|
||||
def __init__(
|
||||
self,
|
||||
dict_: Any = ...,
|
||||
autoescape: bool = ...,
|
||||
use_l10n: Optional[bool] = ...,
|
||||
use_tz: None = ...
|
||||
) -> None: ...
|
||||
class Context(BaseContext):
|
||||
autoescape: Any = ...
|
||||
use_l10n: Any = ...
|
||||
use_tz: Any = ...
|
||||
template_name: str = ...
|
||||
render_context: Any = ...
|
||||
template: Any = ...
|
||||
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: Dict[str, Any]) -> ContextDict: ...
|
||||
|
||||
|
||||
class ContextDict:
|
||||
def __enter__(self) -> ContextDict: ...
|
||||
def __exit__(self, *args, **kwargs) -> None: ...
|
||||
def __init__(self, context: BaseContext, *args, **kwargs) -> None: ...
|
||||
|
||||
|
||||
class RenderContext:
|
||||
class RenderContext(BaseContext):
|
||||
template: Any = ...
|
||||
def __iter__(self) -> None: ...
|
||||
def __contains__(self, key: Union[str, CycleNode]) -> bool: ...
|
||||
def __getitem__(
|
||||
self,
|
||||
key: Union[str, CycleNode]
|
||||
) -> Union[BlockContext, List[Origin], cycle]: ...
|
||||
def __iter__(self): ...
|
||||
def get(
|
||||
self,
|
||||
key: Union[str, InclusionNode],
|
||||
otherwise: None = ...
|
||||
) -> Optional[Union[Template, BlockContext]]: ...
|
||||
def get(self, key: Union[str, InclusionNode], otherwise: None = ...) -> Optional[Union[Template, BlockContext]]: ...
|
||||
def __getitem__(self, key: Union[str, CycleNode]) -> Union[BlockContext, List[Origin], cycle]: ...
|
||||
def push_state(self, template: Template, isolated_context: bool = ...) -> Iterator[None]: ...
|
||||
|
||||
|
||||
class RequestContext:
|
||||
def __init__(
|
||||
self,
|
||||
request: HttpRequest,
|
||||
dict_: None = ...,
|
||||
processors: Optional[List[Callable]] = ...,
|
||||
use_l10n: None = ...,
|
||||
use_tz: None = ...,
|
||||
autoescape: bool = ...
|
||||
) -> None: ...
|
||||
class RequestContext(Context):
|
||||
request: Any = ...
|
||||
_processors: Any = ...
|
||||
_processors_index: Any = ...
|
||||
def __init__(self, request: HttpRequest, dict_: None = ..., processors: Optional[List[Callable]] = ..., use_l10n: None = ..., use_tz: None = ..., autoescape: bool = ...) -> None: ...
|
||||
template: Any = ...
|
||||
def bind_template(self, template: Template) -> Iterator[None]: ...
|
||||
def new(self, values: Any = ...) -> RequestContext: ...
|
||||
def new(self, values: Any = ...) -> RequestContext: ...
|
||||
|
||||
def make_context(context: Any, request: Optional[WSGIRequest] = ..., **kwargs: Any) -> Context: ...
|
||||
@@ -1,22 +1,17 @@
|
||||
# Stubs for django.template.context_processors (Python 3.6)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
|
||||
from typing import Any
|
||||
|
||||
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,
|
||||
)
|
||||
|
||||
|
||||
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 request(request: HttpRequest) -> Dict[str, HttpRequest]: ...
|
||||
def tz(request: Any): ...
|
||||
def static(request: Any): ...
|
||||
def media(request: Any): ...
|
||||
def request(request: HttpRequest) -> Dict[str, HttpRequest]: ...
|
||||
@@ -1,200 +1,73 @@
|
||||
from datetime import (
|
||||
date,
|
||||
time,
|
||||
timedelta,
|
||||
)
|
||||
# Stubs for django.template.defaultfilters (Python 3.6)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
|
||||
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,
|
||||
)
|
||||
|
||||
|
||||
def _property_resolver(arg: Union[str, int]) -> Callable: ...
|
||||
|
||||
|
||||
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]: ...
|
||||
|
||||
from typing import Any, Callable, Dict, List, Optional, Tuple, Union
|
||||
register: Any
|
||||
|
||||
def stringfilter(func: Any): ...
|
||||
def addslashes(value: str) -> str: ...
|
||||
|
||||
|
||||
def capfirst(value: str) -> str: ...
|
||||
|
||||
|
||||
def center(value: str, arg: SafeText) -> str: ...
|
||||
|
||||
|
||||
def cut(value: str, arg: str) -> str: ...
|
||||
|
||||
|
||||
def date(value: Optional[Union[time, date, str]], arg: Optional[str] = ...) -> 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]: ...
|
||||
|
||||
|
||||
def dictsort(
|
||||
value: Union[List[Dict[str, Union[str, int]]], List[Dict[str, str]], List[Tuple[str, str]]],
|
||||
arg: Union[str, int]
|
||||
) -> Union[List[Dict[str, Union[str, int]]], List[Dict[str, str]], List[Tuple[str, str]]]: ...
|
||||
|
||||
|
||||
def dictsortreversed(value: str, arg: str) -> str: ...
|
||||
|
||||
|
||||
def divisibleby(value: int, arg: int) -> bool: ...
|
||||
|
||||
|
||||
def escape_filter(value: str) -> SafeText: ...
|
||||
|
||||
|
||||
def escapejs_filter(value: str) -> SafeText: ...
|
||||
|
||||
|
||||
def filesizeformat(bytes_: Union[str, int]) -> str: ...
|
||||
|
||||
|
||||
def first(value: Union[str, List[str]]) -> str: ...
|
||||
|
||||
|
||||
def floatformat(text: Optional[Union[Decimal, str, float]], arg: Union[str, int] = ...) -> str: ...
|
||||
|
||||
|
||||
def force_escape(value: str) -> SafeText: ...
|
||||
|
||||
|
||||
def get_digit(value: int, arg: int) -> int: ...
|
||||
|
||||
|
||||
def iriencode(value: str) -> str: ...
|
||||
|
||||
|
||||
def join(value: object, arg: str, autoescape: bool = ...) -> object: ...
|
||||
|
||||
|
||||
def json_script(value: Dict[str, str], element_id: SafeText) -> SafeText: ...
|
||||
|
||||
|
||||
def last(value: List[str]) -> str: ...
|
||||
|
||||
|
||||
def length(value: Any) -> int: ...
|
||||
|
||||
|
||||
def length_is(value: Any, arg: Union[SafeText, int]) -> Union[bool, str]: ...
|
||||
|
||||
|
||||
def linebreaks_filter(value: str, autoescape: bool = ...) -> SafeText: ...
|
||||
|
||||
|
||||
def linebreaksbr(value: str, autoescape: bool = ...) -> SafeText: ...
|
||||
|
||||
|
||||
def floatformat(text: Optional[Union[Decimal, str, float]], arg: Union[str, int] = ...) -> str: ...
|
||||
def iriencode(value: str) -> str: ...
|
||||
def linenumbers(value: str, autoescape: bool = ...) -> SafeText: ...
|
||||
|
||||
|
||||
def ljust(value: str, arg: Union[SafeText, int]) -> str: ...
|
||||
|
||||
|
||||
def lower(value: str) -> str: ...
|
||||
|
||||
|
||||
def make_list(value: str) -> List[str]: ...
|
||||
|
||||
|
||||
def phone2numeric_filter(value: str) -> str: ...
|
||||
|
||||
|
||||
def pluralize(value: object, arg: str = ...) -> str: ...
|
||||
|
||||
|
||||
def pprint(value: object) -> str: ...
|
||||
|
||||
|
||||
def random(value: Union[List[str], List[SafeText]]) -> str: ...
|
||||
|
||||
|
||||
def rjust(value: str, arg: Union[SafeText, int]) -> str: ...
|
||||
|
||||
|
||||
def safe(value: str) -> SafeText: ...
|
||||
|
||||
|
||||
def safeseq(value: List[str]) -> List[SafeText]: ...
|
||||
|
||||
|
||||
def slice_filter(value: str, arg: str) -> str: ...
|
||||
|
||||
|
||||
def slugify(value: str) -> SafeText: ...
|
||||
|
||||
|
||||
def stringformat(value: object, arg: str) -> str: ...
|
||||
|
||||
|
||||
def striptags(value: 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: ...
|
||||
|
||||
|
||||
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 unordered_list(value: Any, autoescape: bool = ...) -> SafeText: ...
|
||||
|
||||
|
||||
def upper(value: str) -> str: ...
|
||||
|
||||
|
||||
def urlencode(value: str, safe: None = ...) -> str: ...
|
||||
|
||||
|
||||
def urlize(value: str, autoescape: bool = ...) -> SafeText: ...
|
||||
|
||||
|
||||
def urlizetrunc(
|
||||
value: str,
|
||||
limit: Union[SafeText, int],
|
||||
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 yesno(value: Optional[int], arg: Optional[str] = ...) -> Optional[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 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 _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]) -> Union[List[Dict[str, Union[str, int]]], List[Dict[str, str]], List[Tuple[str, 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 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 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: ...
|
||||
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]: ...
|
||||
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 phone2numeric_filter(value: str) -> str: ...
|
||||
def pprint(value: object) -> str: ...
|
||||
@@ -1,337 +1,187 @@
|
||||
# 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 django.template.base import (
|
||||
FilterExpression,
|
||||
NodeList,
|
||||
Parser,
|
||||
Token,
|
||||
)
|
||||
from django.template.context import (
|
||||
Context,
|
||||
RequestContext,
|
||||
)
|
||||
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 typing import Any, Dict, List, Optional, Tuple, Union
|
||||
register: Any
|
||||
|
||||
|
||||
def autoescape(
|
||||
parser: Parser,
|
||||
token: Token
|
||||
) -> AutoEscapeControlNode: ...
|
||||
|
||||
|
||||
def comment(
|
||||
parser: Parser,
|
||||
token: Token
|
||||
) -> CommentNode: ...
|
||||
|
||||
|
||||
def csrf_token(
|
||||
parser: Parser,
|
||||
token: Token
|
||||
) -> CsrfTokenNode: ...
|
||||
|
||||
|
||||
def cycle(
|
||||
parser: Parser,
|
||||
token: Token
|
||||
) -> CycleNode: ...
|
||||
|
||||
|
||||
def do_filter(
|
||||
parser: Parser,
|
||||
token: Token
|
||||
) -> FilterNode: ...
|
||||
|
||||
|
||||
def do_for(
|
||||
parser: Parser,
|
||||
token: Token
|
||||
) -> ForNode: ...
|
||||
|
||||
|
||||
def do_if(parser: Parser, token: Token) -> IfNode: ...
|
||||
|
||||
|
||||
def do_ifequal(
|
||||
parser: Parser,
|
||||
token: Token,
|
||||
negate: bool
|
||||
) -> IfEqualNode: ...
|
||||
|
||||
|
||||
def do_with(
|
||||
parser: Parser,
|
||||
token: Token
|
||||
) -> WithNode: ...
|
||||
|
||||
|
||||
def find_library(parser: Parser, name: str) -> Library: ...
|
||||
|
||||
|
||||
def firstof(
|
||||
parser: Parser,
|
||||
token: Token
|
||||
) -> FirstOfNode: ...
|
||||
|
||||
|
||||
def ifchanged(
|
||||
parser: Parser,
|
||||
token: Token
|
||||
) -> IfChangedNode: ...
|
||||
|
||||
|
||||
def ifequal(
|
||||
parser: Parser,
|
||||
token: Token
|
||||
) -> IfEqualNode: ...
|
||||
|
||||
|
||||
def ifnotequal(
|
||||
parser: Parser,
|
||||
token: Token
|
||||
) -> IfEqualNode: ...
|
||||
|
||||
|
||||
def load(parser: Parser, token: Token) -> LoadNode: ...
|
||||
|
||||
|
||||
def load_from_library(
|
||||
library: Library,
|
||||
label: str,
|
||||
names: List[str]
|
||||
) -> Library: ...
|
||||
|
||||
|
||||
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: ...
|
||||
|
||||
|
||||
class AutoEscapeControlNode:
|
||||
class AutoEscapeControlNode(Node):
|
||||
def __init__(self, setting: bool, nodelist: NodeList) -> None: ...
|
||||
def render(self, context: Context) -> SafeText: ...
|
||||
|
||||
|
||||
class CommentNode:
|
||||
class CommentNode(Node):
|
||||
def render(self, context: Context) -> str: ...
|
||||
|
||||
|
||||
class CsrfTokenNode:
|
||||
class CsrfTokenNode(Node):
|
||||
def render(self, context: RequestContext) -> SafeText: ...
|
||||
|
||||
|
||||
class CycleNode:
|
||||
def __init__(
|
||||
self,
|
||||
cyclevars: List[FilterExpression],
|
||||
variable_name: Optional[str] = ...,
|
||||
silent: bool = ...
|
||||
) -> None: ...
|
||||
class CycleNode(Node):
|
||||
cyclevars: Any = ...
|
||||
variable_name: Any = ...
|
||||
silent: Any = ...
|
||||
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):
|
||||
def render(self, context: Any): ...
|
||||
|
||||
class FilterNode:
|
||||
def __init__(
|
||||
self,
|
||||
filter_expr: FilterExpression,
|
||||
nodelist: NodeList
|
||||
) -> None: ...
|
||||
class FilterNode(Node):
|
||||
def __init__(self, filter_expr: FilterExpression, nodelist: NodeList) -> None: ...
|
||||
def render(self, context: Context): ...
|
||||
|
||||
|
||||
class FirstOfNode:
|
||||
class FirstOfNode(Node):
|
||||
vars: Any = ...
|
||||
asvar: Any = ...
|
||||
def __init__(self, variables: List[FilterExpression], asvar: Optional[str] = ...) -> None: ...
|
||||
def render(self, context: Context) -> str: ...
|
||||
|
||||
|
||||
class ForNode:
|
||||
def __init__(
|
||||
self,
|
||||
loopvars: List[str],
|
||||
sequence: FilterExpression,
|
||||
is_reversed: bool,
|
||||
nodelist_loop: NodeList,
|
||||
nodelist_empty: Optional[NodeList] = ...
|
||||
) -> None: ...
|
||||
class ForNode(Node):
|
||||
child_nodelists: Any = ...
|
||||
is_reversed: Any = ...
|
||||
nodelist_loop: Any = ...
|
||||
nodelist_empty: Any = ...
|
||||
def __init__(self, loopvars: List[str], sequence: FilterExpression, is_reversed: bool, nodelist_loop: NodeList, nodelist_empty: Optional[NodeList] = ...) -> None: ...
|
||||
def __repr__(self) -> str: ...
|
||||
def render(self, context: Context) -> SafeText: ...
|
||||
|
||||
|
||||
class IfChangedNode:
|
||||
def __init__(
|
||||
self,
|
||||
nodelist_true: NodeList,
|
||||
nodelist_false: NodeList,
|
||||
*varlist
|
||||
) -> None: ...
|
||||
def _get_context_stack_frame(self, context: Context) -> Any: ...
|
||||
class IfChangedNode(Node):
|
||||
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:
|
||||
def __init__(
|
||||
self,
|
||||
var1: FilterExpression,
|
||||
var2: FilterExpression,
|
||||
nodelist_true: NodeList,
|
||||
nodelist_false: NodeList,
|
||||
negate: bool
|
||||
) -> None: ...
|
||||
class IfEqualNode(Node):
|
||||
child_nodelists: Any = ...
|
||||
negate: Any = ...
|
||||
def __init__(self, var1: FilterExpression, var2: FilterExpression, nodelist_true: NodeList, nodelist_false: NodeList, negate: bool) -> None: ...
|
||||
def __repr__(self): ...
|
||||
def render(self, context: Context) -> SafeText: ...
|
||||
|
||||
|
||||
class IfNode:
|
||||
def __init__(
|
||||
self,
|
||||
conditions_nodelists: Union[List[Tuple[TemplateLiteral, NodeList]], List[Union[Tuple[TemplateLiteral, NodeList], Tuple[None, NodeList]]]]
|
||||
) -> None: ...
|
||||
def __iter__(self) -> None: ...
|
||||
class IfNode(Node):
|
||||
conditions_nodelists: Any = ...
|
||||
def __init__(self, conditions_nodelists: Union[List[Tuple[TemplateLiteral, NodeList]], List[Union[Tuple[TemplateLiteral, NodeList], Tuple[None, NodeList]]]]) -> None: ...
|
||||
def __repr__(self) -> str: ...
|
||||
def __iter__(self) -> None: ...
|
||||
@property
|
||||
def nodelist(self) -> NodeList: ...
|
||||
def render(self, context: Context) -> str: ...
|
||||
|
||||
|
||||
class LoadNode:
|
||||
def render(self, context: Context) -> str: ...
|
||||
|
||||
|
||||
class LoremNode:
|
||||
class LoremNode(Node):
|
||||
def __init__(self, count: FilterExpression, method: str, common: bool) -> None: ...
|
||||
def render(self, context: Context) -> str: ...
|
||||
|
||||
GroupedResult = namedtuple('GroupedResult', ['grouper', 'list'])
|
||||
|
||||
class NowNode:
|
||||
class RegroupNode(Node):
|
||||
var_name: Any = ...
|
||||
def __init__(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]: ...
|
||||
def render(self, context: Context) -> str: ...
|
||||
|
||||
class LoadNode(Node):
|
||||
def render(self, context: Context) -> str: ...
|
||||
|
||||
class NowNode(Node):
|
||||
format_string: Any = ...
|
||||
asvar: Any = ...
|
||||
def __init__(self, format_string: str, asvar: None = ...) -> None: ...
|
||||
def render(self, context: Context) -> str: ...
|
||||
|
||||
|
||||
class RegroupNode:
|
||||
def __init__(
|
||||
self,
|
||||
target: FilterExpression,
|
||||
expression: FilterExpression,
|
||||
var_name: str
|
||||
) -> None: ...
|
||||
def render(self, context: Context) -> str: ...
|
||||
def resolve_expression(
|
||||
self,
|
||||
obj: Dict[str, Union[str, int, date, List[str]]],
|
||||
context: Context
|
||||
) -> Union[int, str]: ...
|
||||
|
||||
|
||||
class ResetCycleNode:
|
||||
class ResetCycleNode(Node):
|
||||
node: Any = ...
|
||||
def __init__(self, node: CycleNode) -> None: ...
|
||||
def render(self, context: Context) -> str: ...
|
||||
|
||||
|
||||
class SpacelessNode:
|
||||
class SpacelessNode(Node):
|
||||
nodelist: Any = ...
|
||||
def __init__(self, nodelist: NodeList) -> None: ...
|
||||
def render(self, context: Context) -> str: ...
|
||||
|
||||
class TemplateTagNode(Node):
|
||||
mapping: Any = ...
|
||||
tagtype: Any = ...
|
||||
def __init__(self, tagtype: str) -> None: ...
|
||||
def render(self, context: Context) -> str: ...
|
||||
|
||||
class TemplateIfParser:
|
||||
def __init__(self, parser: Parser, *args, **kwargs) -> None: ...
|
||||
def create_var(self, value: str) -> TemplateLiteral: ...
|
||||
class URLNode(Node):
|
||||
view_name: Any = ...
|
||||
args: Any = ...
|
||||
kwargs: Any = ...
|
||||
asvar: Any = ...
|
||||
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):
|
||||
content: Any = ...
|
||||
def __init__(self, content: SafeText) -> None: ...
|
||||
def render(self, context: Context) -> SafeText: ...
|
||||
|
||||
class TemplateLiteral:
|
||||
class WidthRatioNode(Node):
|
||||
val_expr: Any = ...
|
||||
max_expr: Any = ...
|
||||
max_width: Any = ...
|
||||
asvar: Any = ...
|
||||
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):
|
||||
nodelist: Any = ...
|
||||
extra_context: Any = ...
|
||||
def __init__(self, var: None, name: None, nodelist: NodeList, extra_context: Dict[str, FilterExpression] = ...) -> None: ...
|
||||
def __repr__(self): ...
|
||||
def render(self, context: Context): ...
|
||||
|
||||
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 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: Any = ...
|
||||
text: Any = ...
|
||||
def __init__(self, value: FilterExpression, text: str) -> None: ...
|
||||
def display(self) -> str: ...
|
||||
def eval(self, context: Context) -> Any: ...
|
||||
|
||||
class TemplateIfParser(IfParser):
|
||||
error_class: Any = ...
|
||||
template_parser: Any = ...
|
||||
def __init__(self, parser: Parser, *args: Any, **kwargs: Any) -> None: ...
|
||||
def create_var(self, value: str) -> TemplateLiteral: ...
|
||||
|
||||
class TemplateTagNode:
|
||||
def __init__(self, tagtype: str) -> None: ...
|
||||
def render(self, context: Context) -> str: ...
|
||||
|
||||
|
||||
class URLNode:
|
||||
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:
|
||||
def __init__(self, content: SafeText) -> None: ...
|
||||
def render(self, context: Context) -> SafeText: ...
|
||||
|
||||
|
||||
class WidthRatioNode:
|
||||
def __init__(
|
||||
self,
|
||||
val_expr: FilterExpression,
|
||||
max_expr: FilterExpression,
|
||||
max_width: FilterExpression,
|
||||
asvar: Optional[str] = ...
|
||||
) -> None: ...
|
||||
def render(self, context: Context) -> str: ...
|
||||
|
||||
|
||||
class WithNode:
|
||||
def __init__(
|
||||
self,
|
||||
var: None,
|
||||
name: None,
|
||||
nodelist: NodeList,
|
||||
extra_context: Dict[str, FilterExpression] = ...
|
||||
) -> None: ...
|
||||
def render(self, context: Context): ...
|
||||
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: ...
|
||||
@@ -1,62 +1,46 @@
|
||||
from django.template.base import (
|
||||
Origin,
|
||||
Template,
|
||||
)
|
||||
# Stubs for django.template.engine (Python 3.6)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
|
||||
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,
|
||||
)
|
||||
|
||||
|
||||
from typing import Any, Callable, Dict, List, Optional, Tuple, Union
|
||||
class Engine:
|
||||
def __init__(
|
||||
self,
|
||||
dirs: Optional[List[str]] = ...,
|
||||
app_dirs: bool = ...,
|
||||
context_processors: Optional[Union[List[str], Tuple[str, str]]] = ...,
|
||||
debug: bool = ...,
|
||||
loaders: Any = ...,
|
||||
string_if_invalid: str = ...,
|
||||
file_charset: str = ...,
|
||||
libraries: Optional[Dict[str, str]] = ...,
|
||||
builtins: Optional[List[str]] = ...,
|
||||
autoescape: bool = ...
|
||||
) -> None: ...
|
||||
def find_template(
|
||||
self,
|
||||
name: str,
|
||||
dirs: None = ...,
|
||||
skip: Optional[List[Origin]] = ...
|
||||
) -> Tuple[Template, Origin]: ...
|
||||
def find_template_loader(
|
||||
self,
|
||||
loader: Union[Tuple[str, List[Tuple[str, Dict[str, str]]]], Tuple[str, List[str]], Tuple[str, Dict[str, str]], str]
|
||||
) -> Loader: ...
|
||||
def from_string(self, template_code: str) -> Template: ...
|
||||
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 = ...
|
||||
def __init__(self, dirs: Optional[List[str]] = ..., app_dirs: bool = ..., context_processors: Optional[Union[List[str], Tuple[str, str]]] = ..., debug: bool = ..., loaders: Any = ..., 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 get_template(self, template_name: str) -> Template: ...
|
||||
def template_context_processors(self) -> Union[Tuple[Callable, Callable, Callable], Tuple[Callable], Tuple[Callable, Callable, Callable, Callable, Callable], Tuple[Callable, 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 find_template_loader(self, loader: Union[Tuple[str, List[Tuple[str, Dict[str, str]]]], Tuple[str, List[str]], Tuple[str, Dict[str, 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: ...
|
||||
@cached_property
|
||||
def template_context_processors(
|
||||
self
|
||||
) -> Union[Tuple[Callable, Callable, Callable], Tuple[Callable], Tuple[Callable, Callable, Callable, Callable, Callable], Tuple[Callable, Callable]]: ...
|
||||
@cached_property
|
||||
def template_loaders(
|
||||
self
|
||||
) -> Union[List[Loader], List[Loader], List[Loader]]: ...
|
||||
@@ -1,18 +1,16 @@
|
||||
# Stubs for django.template.exceptions (Python 3.6)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
|
||||
from typing import Any, Optional
|
||||
|
||||
from django.template.backends.base import BaseEngine
|
||||
from django.template.base import Origin
|
||||
from typing import (
|
||||
List,
|
||||
Optional,
|
||||
Tuple,
|
||||
Union,
|
||||
)
|
||||
from typing import List, Optional, Tuple, Union
|
||||
class TemplateDoesNotExist(Exception):
|
||||
backend: Any = ...
|
||||
tried: Any = ...
|
||||
chain: Any = ...
|
||||
def __init__(self, msg: Union[str, Origin], tried: Optional[List[Tuple[Origin, str]]] = ..., backend: Optional[BaseEngine] = ..., chain: Optional[List[TemplateDoesNotExist]] = ...) -> None: ...
|
||||
|
||||
|
||||
class TemplateDoesNotExist:
|
||||
def __init__(
|
||||
self,
|
||||
msg: Union[str, Origin],
|
||||
tried: Optional[List[Tuple[Origin, str]]] = ...,
|
||||
backend: Optional[BaseEngine] = ...,
|
||||
chain: Optional[List[TemplateDoesNotExist]] = ...
|
||||
) -> None: ...
|
||||
class TemplateSyntaxError(Exception): ...
|
||||
@@ -1,98 +1,45 @@
|
||||
from django.template.base import (
|
||||
FilterExpression,
|
||||
Parser,
|
||||
Template,
|
||||
)
|
||||
# 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 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,
|
||||
)
|
||||
|
||||
|
||||
def import_library(name: str) -> Library: ...
|
||||
|
||||
|
||||
def parse_bits(
|
||||
parser: Parser,
|
||||
bits: List[str],
|
||||
params: List[str],
|
||||
varargs: Optional[str],
|
||||
varkw: None,
|
||||
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]]]: ...
|
||||
|
||||
|
||||
class InclusionNode:
|
||||
def __init__(
|
||||
self,
|
||||
func: Callable,
|
||||
takes_context: Optional[bool],
|
||||
args: List[FilterExpression],
|
||||
kwargs: Dict[Any, Any],
|
||||
filename: Optional[Union[str, Template]]
|
||||
) -> None: ...
|
||||
def render(self, context: Context) -> SafeText: ...
|
||||
|
||||
from typing import Any, Callable, Dict, List, Optional, Tuple, Union
|
||||
class InvalidTemplateLibrary(Exception): ...
|
||||
|
||||
class Library:
|
||||
filters: Any = ...
|
||||
tags: Any = ...
|
||||
def __init__(self) -> None: ...
|
||||
def filter(
|
||||
self,
|
||||
name: Optional[Union[str, Callable]] = ...,
|
||||
filter_func: Optional[Callable] = ...,
|
||||
**flags
|
||||
) -> Callable: ...
|
||||
def filter_function(self, func: Callable, **flags) -> Callable: ...
|
||||
def inclusion_tag(
|
||||
self,
|
||||
filename: Union[str, Template],
|
||||
func: None = ...,
|
||||
takes_context: Optional[bool] = ...,
|
||||
name: Optional[str] = ...
|
||||
) -> Callable: ...
|
||||
def simple_tag(
|
||||
self,
|
||||
func: Optional[Callable] = ...,
|
||||
takes_context: Optional[bool] = ...,
|
||||
name: Optional[str] = ...
|
||||
) -> Callable: ...
|
||||
def tag(
|
||||
self,
|
||||
name: Optional[Union[str, Callable]] = ...,
|
||||
compile_function: Optional[Union[str, Callable]] = ...
|
||||
) -> Callable: ...
|
||||
def tag(self, name: Optional[Union[str, Callable]] = ..., compile_function: Optional[Union[str, Callable]] = ...) -> Callable: ...
|
||||
def tag_function(self, func: Callable) -> Callable: ...
|
||||
def filter(self, name: Optional[Union[str, Callable]] = ..., filter_func: Optional[Callable] = ..., **flags: Any) -> Callable: ...
|
||||
def filter_function(self, func: Callable, **flags: Any) -> Callable: ...
|
||||
def simple_tag(self, func: Optional[Callable] = ..., takes_context: Optional[bool] = ..., name: Optional[str] = ...) -> Callable: ...
|
||||
def inclusion_tag(self, filename: Union[str, Template], 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[Any, Any]) -> None: ...
|
||||
def get_resolved_arguments(self, context: Context) -> Any: ...
|
||||
|
||||
class SimpleNode:
|
||||
def __init__(
|
||||
self,
|
||||
func: Callable,
|
||||
takes_context: Optional[bool],
|
||||
args: List[FilterExpression],
|
||||
kwargs: Dict[str, FilterExpression],
|
||||
target_var: Optional[str]
|
||||
) -> None: ...
|
||||
class SimpleNode(TagHelperNode):
|
||||
target_var: Any = ...
|
||||
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):
|
||||
filename: Any = ...
|
||||
def __init__(self, func: Callable, takes_context: Optional[bool], args: List[FilterExpression], kwargs: Dict[Any, Any], filename: Optional[Union[str, Template]]) -> None: ...
|
||||
def render(self, context: Context) -> SafeText: ...
|
||||
|
||||
class TagHelperNode:
|
||||
def __init__(
|
||||
self,
|
||||
func: Callable,
|
||||
takes_context: Optional[bool],
|
||||
args: List[FilterExpression],
|
||||
kwargs: Dict[Any, Any]
|
||||
) -> None: ...
|
||||
def get_resolved_arguments(self, context: Context) -> Any: ...
|
||||
def parse_bits(parser: Parser, bits: List[str], params: List[str], varargs: Optional[str], varkw: None, 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]]]: ...
|
||||
def import_library(name: str) -> Library: ...
|
||||
@@ -1,31 +1,15 @@
|
||||
# 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 _engine_list(
|
||||
using: Optional[str] = ...
|
||||
) -> Union[List[BaseEngine], List[DjangoTemplates]]: ...
|
||||
|
||||
|
||||
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 render_to_string(
|
||||
template_name: Union[str, List[str]],
|
||||
context: Any = ...,
|
||||
request: Optional[WSGIRequest] = ...,
|
||||
using: Optional[str] = ...
|
||||
) -> str: ...
|
||||
|
||||
|
||||
def select_template(template_name_list: List[str], using: None = ...) -> Template: ...
|
||||
def select_template(template_name_list: List[str], using: None = ...) -> 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,78 +1,54 @@
|
||||
from django.template.base import (
|
||||
FilterExpression,
|
||||
NodeList,
|
||||
Parser,
|
||||
Template,
|
||||
Token,
|
||||
)
|
||||
# Stubs for django.template.loader_tags (Python 3.6)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
|
||||
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.context import Context
|
||||
from django.utils.safestring import SafeText
|
||||
from typing import (
|
||||
Dict,
|
||||
Optional,
|
||||
)
|
||||
|
||||
|
||||
def construct_relative_path(current_template_name: Optional[str], relative_name: str) -> str: ...
|
||||
|
||||
|
||||
def do_block(
|
||||
parser: Parser,
|
||||
token: Token
|
||||
) -> BlockNode: ...
|
||||
|
||||
|
||||
def do_extends(
|
||||
parser: Parser,
|
||||
token: Token
|
||||
) -> ExtendsNode: ...
|
||||
|
||||
|
||||
def do_include(
|
||||
parser: Parser,
|
||||
token: Token
|
||||
) -> IncludeNode: ...
|
||||
|
||||
from typing import Dict, Optional
|
||||
register: Any
|
||||
BLOCK_CONTEXT_KEY: str
|
||||
|
||||
class BlockContext:
|
||||
blocks: Any = ...
|
||||
def __init__(self) -> None: ...
|
||||
def add_blocks(self, blocks: Dict[str, BlockNode]) -> None: ...
|
||||
def get_block(self, name: str) -> BlockNode: ...
|
||||
def pop(self, name: str) -> BlockNode: ...
|
||||
def push(self, name: str, block: BlockNode) -> None: ...
|
||||
def get_block(self, name: str) -> BlockNode: ...
|
||||
|
||||
|
||||
class BlockNode:
|
||||
class BlockNode(Node):
|
||||
def __init__(self, name: str, nodelist: NodeList, parent: None = ...) -> None: ...
|
||||
def __repr__(self) -> str: ...
|
||||
def render(self, context: Context) -> SafeText: ...
|
||||
def super(self) -> SafeText: ...
|
||||
|
||||
|
||||
class ExtendsNode:
|
||||
def __init__(
|
||||
self,
|
||||
nodelist: NodeList,
|
||||
parent_name: FilterExpression,
|
||||
template_dirs: None = ...
|
||||
) -> None: ...
|
||||
class ExtendsNode(Node):
|
||||
must_be_first: bool = ...
|
||||
context_key: str = ...
|
||||
nodelist: Any = ...
|
||||
parent_name: Any = ...
|
||||
template_dirs: Any = ...
|
||||
blocks: Any = ...
|
||||
def __init__(self, nodelist: NodeList, parent_name: FilterExpression, template_dirs: None = ...) -> 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): ...
|
||||
|
||||
class IncludeNode(Node):
|
||||
context_key: str = ...
|
||||
template: Any = ...
|
||||
extra_context: Any = ...
|
||||
isolated_context: Any = ...
|
||||
def __init__(self, template: FilterExpression, *args: Any, extra_context: Optional[Any] = ..., isolated_context: bool = ..., **kwargs: Any) -> None: ...
|
||||
def render(self, context: Context) -> SafeText: ...
|
||||
|
||||
class IncludeNode:
|
||||
def __init__(
|
||||
self,
|
||||
template: FilterExpression,
|
||||
*args,
|
||||
extra_context = ...,
|
||||
isolated_context = ...,
|
||||
**kwargs
|
||||
) -> 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: ...
|
||||
@@ -1,8 +1,9 @@
|
||||
from typing import (
|
||||
Tuple,
|
||||
Union,
|
||||
)
|
||||
# Stubs for django.template.loaders.app_directories (Python 3.6)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
|
||||
from .filesystem import Loader as FilesystemLoader
|
||||
|
||||
class Loader:
|
||||
def get_dirs(self) -> Union[Tuple[str, str], Tuple[str, str, str], Tuple[str], Tuple[str, str, str, str]]: ...
|
||||
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]]: ...
|
||||
@@ -1,18 +1,15 @@
|
||||
from django.template.base import (
|
||||
Origin,
|
||||
Template,
|
||||
)
|
||||
# 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 django.template.base import Origin, Template
|
||||
from django.template.engine import Engine
|
||||
from typing import (
|
||||
List,
|
||||
Optional,
|
||||
)
|
||||
|
||||
|
||||
from typing import List, Optional
|
||||
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(self, template_name: str, skip: Optional[List[Origin]] = ...) -> Template: ...
|
||||
def get_template_sources(self, template_name: Any) -> None: ...
|
||||
def reset(self) -> None: ...
|
||||
@@ -1,29 +1,21 @@
|
||||
from django.template.base import (
|
||||
Origin,
|
||||
Template,
|
||||
)
|
||||
# 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 django.template.base import Origin, Template
|
||||
from django.template.engine import Engine
|
||||
from typing import (
|
||||
Dict,
|
||||
List,
|
||||
Optional,
|
||||
Tuple,
|
||||
Union,
|
||||
)
|
||||
|
||||
|
||||
class Loader:
|
||||
def __init__(
|
||||
self,
|
||||
engine: Engine,
|
||||
loaders: Union[List[Tuple[str, Dict[str, str]]], List[str]]
|
||||
) -> None: ...
|
||||
from typing import Dict, List, Optional, Tuple, Union
|
||||
class Loader(BaseLoader):
|
||||
template_cache: Any = ...
|
||||
get_template_cache: Any = ...
|
||||
loaders: Any = ...
|
||||
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 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 reset(self) -> None: ...
|
||||
@@ -1,14 +1,16 @@
|
||||
# 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 django.template.base import Origin
|
||||
from django.template.engine import Engine
|
||||
from typing import (
|
||||
Iterator,
|
||||
List,
|
||||
Union,
|
||||
)
|
||||
|
||||
|
||||
class Loader:
|
||||
from typing import Iterator, List, Union
|
||||
class Loader(BaseLoader):
|
||||
dirs: Any = ...
|
||||
def __init__(self, engine: Engine, dirs: None = ...) -> None: ...
|
||||
def get_contents(self, origin: Origin): ...
|
||||
def get_dirs(self) -> List[str]: ...
|
||||
def get_template_sources(self, template_name: Union[bytes, str]) -> Iterator[Origin]: ...
|
||||
def get_contents(self, origin: Origin): ...
|
||||
def get_template_sources(self, template_name: Union[bytes, str]) -> Iterator[Origin]: ...
|
||||
@@ -1,12 +1,15 @@
|
||||
# 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 django.template.base import Origin
|
||||
from django.template.engine import Engine
|
||||
from typing import (
|
||||
Dict,
|
||||
Iterator,
|
||||
)
|
||||
|
||||
|
||||
class Loader:
|
||||
from typing import Dict, Iterator
|
||||
class Loader(BaseLoader):
|
||||
templates_dict: Any = ...
|
||||
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]: ...
|
||||
def get_template_sources(self, template_name: str) -> Iterator[Origin]: ...
|
||||
@@ -1,48 +1,43 @@
|
||||
# Stubs for django.template.response (Python 3.6)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
|
||||
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.utils.safestring import SafeText
|
||||
from typing import (
|
||||
Any,
|
||||
Callable,
|
||||
Dict,
|
||||
List,
|
||||
Optional,
|
||||
Union,
|
||||
)
|
||||
from typing import Any, Callable, Dict, List, Optional, Union
|
||||
class ContentNotRenderedError(Exception): ...
|
||||
|
||||
|
||||
class SimpleTemplateResponse:
|
||||
class SimpleTemplateResponse(HttpResponse):
|
||||
rendering_attrs: Any = ...
|
||||
template_name: Any = ...
|
||||
context_data: Any = ...
|
||||
using: Any = ...
|
||||
_post_render_callbacks: Any = ...
|
||||
_request: Any = ...
|
||||
_is_rendered: bool = ...
|
||||
def __init__(self, template: Union[str, List[str], Template], context: Any = ..., content_type: Optional[str] = ..., status: Optional[int] = ..., charset: Optional[str] = ..., using: None = ...) -> None: ...
|
||||
def __getstate__(self) -> Dict[str, Any]: ...
|
||||
def __init__(
|
||||
self,
|
||||
template: Union[str, List[str], Template],
|
||||
context: Any = ...,
|
||||
content_type: Optional[str] = ...,
|
||||
status: Optional[int] = ...,
|
||||
charset: Optional[str] = ...,
|
||||
using: None = ...
|
||||
) -> None: ...
|
||||
def add_post_render_callback(self, callback: Callable) -> None: ...
|
||||
@property
|
||||
def is_rendered(self) -> bool: ...
|
||||
def render(self) -> SimpleTemplateResponse: ...
|
||||
def resolve_template(self, template: Union[str, List[str], Template]) -> Template: ...
|
||||
def resolve_context(self, context: Any) -> Any: ...
|
||||
@property
|
||||
def rendered_content(self) -> SafeText: ...
|
||||
def resolve_context(self, context: Any) -> Any: ...
|
||||
def resolve_template(
|
||||
self,
|
||||
template: Union[str, List[str], Template]
|
||||
) -> Template: ...
|
||||
def add_post_render_callback(self, callback: Callable) -> None: ...
|
||||
content: Any = ...
|
||||
def render(self) -> SimpleTemplateResponse: ...
|
||||
@property
|
||||
def is_rendered(self) -> bool: ...
|
||||
def __iter__(self): ...
|
||||
@property
|
||||
def content(self): ...
|
||||
@content.setter
|
||||
def content(self, value: Any) -> None: ...
|
||||
|
||||
|
||||
class TemplateResponse:
|
||||
def __init__(
|
||||
self,
|
||||
request: HttpRequest,
|
||||
template: Union[str, List[str], Template],
|
||||
context: Any = ...,
|
||||
content_type: Optional[str] = ...,
|
||||
status: Optional[int] = ...,
|
||||
charset: None = ...,
|
||||
using: None = ...
|
||||
) -> None: ...
|
||||
class TemplateResponse(SimpleTemplateResponse):
|
||||
rendering_attrs: Any = ...
|
||||
_request: Any = ...
|
||||
def __init__(self, request: HttpRequest, template: Union[str, List[str], Template], context: Any = ..., content_type: Optional[str] = ..., status: Optional[int] = ..., charset: None = ..., using: None = ...) -> None: ...
|
||||
@@ -1,24 +1,48 @@
|
||||
from django.template.defaulttags import TemplateLiteral
|
||||
from typing import (
|
||||
Any,
|
||||
Dict,
|
||||
List,
|
||||
Optional,
|
||||
Union,
|
||||
)
|
||||
# Stubs for django.template.smartif (Python 3.6)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
|
||||
from typing import Any
|
||||
|
||||
from django.template.defaulttags import TemplateLiteral
|
||||
from typing import Any, Dict, List, Optional, Union
|
||||
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 __repr__(self): ...
|
||||
|
||||
def infix(bp: Any, func: Any): ...
|
||||
def prefix(bp: Any, func: Any): ...
|
||||
|
||||
OPERATORS: Any
|
||||
|
||||
class Literal(TokenBase):
|
||||
id: str = ...
|
||||
lbp: int = ...
|
||||
value: Any = ...
|
||||
def __init__(self, value: Optional[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: ...
|
||||
|
||||
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: Any) -> None: ...
|
||||
def create_var(self, value: Optional[Union[List[int], int]]) -> Literal: ...
|
||||
def expression(self, rbp: int = ...) -> Literal: ...
|
||||
def translate_token(self, token: Union[str, List[int], int]) -> Literal: ...
|
||||
def next_token(self) -> Literal: ...
|
||||
def parse(self) -> TemplateLiteral: ...
|
||||
def translate_token(self, token: Union[str, List[int], int]) -> Literal: ...
|
||||
|
||||
|
||||
class Literal:
|
||||
def __init__(self, value: Optional[int]) -> None: ...
|
||||
def __repr__(self) -> str: ...
|
||||
def eval(self, context: Dict[Any, Any]) -> Optional[Union[List[int], int]]: ...
|
||||
def nud(self, parser: IfParser) -> Literal: ...
|
||||
def expression(self, rbp: int = ...) -> Literal: ...
|
||||
def create_var(self, value: Optional[Union[List[int], int]]) -> Literal: ...
|
||||
@@ -1,22 +1,24 @@
|
||||
# Stubs for django.template.utils (Python 3.6)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
|
||||
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,
|
||||
)
|
||||
|
||||
|
||||
def get_app_template_dirs(dirname: str) -> Tuple: ...
|
||||
|
||||
from typing import List, Tuple, Union
|
||||
class InvalidTemplateEngineError(ImproperlyConfigured): ...
|
||||
|
||||
class EngineHandler:
|
||||
_templates: Any = ...
|
||||
_engines: Any = ...
|
||||
def __init__(self, templates: Optional[Any] = ...) -> None: ...
|
||||
def templates(self) -> OrderedDict: ...
|
||||
def __getitem__(self, alias: str) -> BaseEngine: ...
|
||||
def __iter__(self): ...
|
||||
def all(
|
||||
self
|
||||
) -> Union[List[BaseEngine], List[TemplateStrings], List[DjangoTemplates]]: ...
|
||||
@cached_property
|
||||
def templates(self) -> OrderedDict: ...
|
||||
def all(self) -> Union[List[BaseEngine], List[TemplateStrings], List[DjangoTemplates]]: ...
|
||||
|
||||
def get_app_template_dirs(dirname: str) -> Tuple: ...
|
||||
Reference in new issue
Block a user