File: base.pyi

package info (click to toggle)
python-django-stubs 5.2.9-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 4,832 kB
  • sloc: python: 5,185; makefile: 15; sh: 8
file content (28 lines) | stat: -rw-r--r-- 977 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
from collections.abc import Iterator, Mapping
from typing import Any, Protocol, type_check_only

from django.core.checks.messages import CheckMessage
from django.http.request import HttpRequest
from django.utils.functional import cached_property

class BaseEngine:
    name: str
    dirs: list[str]
    app_dirs: bool
    def __init__(self, params: Mapping[str, Any]) -> None: ...
    def check(self, **kwargs: Any) -> list[CheckMessage]: ...
    @property
    def app_dirname(self) -> str: ...
    def from_string(self, template_code: str) -> _EngineTemplate: ...
    def get_template(self, template_name: str) -> _EngineTemplate: ...
    @cached_property
    def template_dirs(self) -> tuple[str, ...]: ...
    def iter_template_filenames(self, template_name: str) -> Iterator[str]: ...

@type_check_only
class _EngineTemplate(Protocol):
    def render(
        self,
        context: dict[str, Any] | None = ...,
        request: HttpRequest | None = ...,
    ) -> str: ...