Skip to content

Commit

Permalink
Added types for template.backends.django.Template (#1302)
Browse files Browse the repository at this point in the history
* Added types for template.backends.django.Template

* Changed origin import
  • Loading branch information
smithdc1 committed Dec 29, 2022
1 parent 0a61343 commit c3949b6
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion django-stubs/template/backends/django.pyi
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
from collections.abc import Iterator
from typing import Any, NoReturn

from django.template.base import Origin
from django.template.base import Template as _BaseTemplate
from django.template.engine import Engine
from django.template.exceptions import TemplateDoesNotExist

from .base import BaseEngine
from .base import BaseEngine, _EngineTemplate

class DjangoTemplates(BaseEngine):
engine: Engine
Expand All @@ -15,3 +17,10 @@ def copy_exception(exc: TemplateDoesNotExist, backend: DjangoTemplates | None =
def reraise(exc: TemplateDoesNotExist, backend: DjangoTemplates) -> NoReturn: ...
def get_installed_libraries() -> dict[str, str]: ...
def get_package_libraries(pkg: Any) -> Iterator[str]: ...

class Template(_EngineTemplate):
template: _BaseTemplate
backend: DjangoTemplates
def __init__(self, template: _BaseTemplate, backend: BaseEngine) -> None: ...
@property
def origin(self) -> Origin: ...

0 comments on commit c3949b6

Please sign in to comment.