mirror of
https://github.com/django/django.git
synced 2025-08-02 10:02:41 +00:00
[2.0.x] Fixed #28891 -- Documented Origin's loader attribute.
Backport of 16bd4964df
from master
This commit is contained in:
parent
66ccb3acb9
commit
6dea1b18f3
1 changed files with 12 additions and 1 deletions
|
@ -1051,7 +1051,7 @@ Template origin
|
||||||
Templates have an ``origin`` containing attributes depending on the source
|
Templates have an ``origin`` containing attributes depending on the source
|
||||||
they are loaded from.
|
they are loaded from.
|
||||||
|
|
||||||
.. class:: Origin
|
.. class:: Origin(name, template_name=None, loader=None)
|
||||||
|
|
||||||
.. attribute:: name
|
.. attribute:: name
|
||||||
|
|
||||||
|
@ -1069,3 +1069,14 @@ they are loaded from.
|
||||||
|
|
||||||
If the template is instantiated directly rather than through a
|
If the template is instantiated directly rather than through a
|
||||||
template loader, this is ``None``.
|
template loader, this is ``None``.
|
||||||
|
|
||||||
|
.. attribute:: loader
|
||||||
|
|
||||||
|
The template loader instance that constructed this ``Origin``.
|
||||||
|
|
||||||
|
If the template is instantiated directly rather than through a
|
||||||
|
template loader, this is ``None``.
|
||||||
|
|
||||||
|
:class:`django.template.loaders.cached.Loader` requires all of its
|
||||||
|
wrapped loaders to set this attribute, typically by instantiating
|
||||||
|
the ``Origin`` with ``loader=self``.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue