From 6dea1b18f3ef0f4a2538114b151119f00be1a1e7 Mon Sep 17 00:00:00 2001 From: M Somerville Date: Thu, 7 Dec 2017 17:19:58 +0000 Subject: [PATCH] [2.0.x] Fixed #28891 -- Documented Origin's loader attribute. Backport of 16bd4964dfd75759cb3ec0c786e1b5dcc8296fd9 from master --- docs/ref/templates/api.txt | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/docs/ref/templates/api.txt b/docs/ref/templates/api.txt index 26c4ad545c..62322b5a21 100644 --- a/docs/ref/templates/api.txt +++ b/docs/ref/templates/api.txt @@ -1051,7 +1051,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 @@ -1069,3 +1069,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``.