summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorM Somerville <dracos@users.noreply.github.com>2017-12-07 17:19:58 +0000
committerTim Graham <timograham@gmail.com>2017-12-07 12:19:58 -0500
commit16bd4964dfd75759cb3ec0c786e1b5dcc8296fd9 (patch)
treea25fd6f37515ca8c82be0e8359c0b14902b51a28 /docs
parent2d75e74e18def5de8b23f88f4257f262f18fe1a9 (diff)
Fixed #28891 -- Documented Origin's loader attribute.
Diffstat (limited to 'docs')
-rw-r--r--docs/ref/templates/api.txt13
1 files changed, 12 insertions, 1 deletions
diff --git a/docs/ref/templates/api.txt b/docs/ref/templates/api.txt
index f441dffefe..b20f91e1e4 100644
--- a/docs/ref/templates/api.txt
+++ b/docs/ref/templates/api.txt
@@ -1036,7 +1036,7 @@ Template origin
Templates have an ``origin`` containing attributes depending on the source
they are loaded from.
-.. class:: Origin
+.. class:: Origin(name, template_name=None, loader=None)
.. attribute:: name
@@ -1054,3 +1054,14 @@ they are loaded from.
If the template is instantiated directly rather than through a
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``.