summaryrefslogtreecommitdiff
path: root/docs/ref
diff options
context:
space:
mode:
authorAymeric Augustin <aymeric.augustin@m4x.org>2015-02-17 22:49:59 +0100
committerAymeric Augustin <aymeric.augustin@m4x.org>2015-02-19 22:08:11 +0100
commit1bfcc950ab6e5264bbaf2eba0ce3d3e23d671404 (patch)
tree344355bd667ab1a7ab33c3c89bfdf59cb03090bf /docs/ref
parentefb1f99f943b99624c78b91ff58502125490191e (diff)
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.
Diffstat (limited to 'docs/ref')
-rw-r--r--docs/ref/templates/upgrading.txt4
1 files changed, 2 insertions, 2 deletions
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()``
==============