From 1bfcc950ab6e5264bbaf2eba0ce3d3e23d671404 Mon Sep 17 00:00:00 2001 From: Aymeric Augustin Date: Tue, 17 Feb 2015 22:49:59 +0100 Subject: Set context.template instead of context.engine while rendering. This opens more possibilities, like accessing context.template.origin. It also follows the chain of objects instead of following a shortcut. --- docs/ref/templates/upgrading.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'docs/ref') diff --git a/docs/ref/templates/upgrading.txt b/docs/ref/templates/upgrading.txt index b2ef23c4b8..6fdab53c40 100644 --- a/docs/ref/templates/upgrading.txt +++ b/docs/ref/templates/upgrading.txt @@ -162,7 +162,7 @@ instance in the ``render()`` method of a template tag, you can use the current You can write:: - template = context.engine.get_template('included.html') + template = context.template.engine.get_template('included.html') This will load the template with the current engine without triggering the multiple template engines machinery, which is usually the desired behavior. @@ -201,7 +201,7 @@ APIs. The multiple template engines machinery isn't involved here. Finally, if you have access to the current context, you can use the same trick as above:: - template = context.engine.from_string(template_code) + template = context.template.engine.from_string(template_code) ``Template()`` ============== -- cgit v1.3