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:10:56 +0100
commitcc4effba0bf07fbcb4dcc0074af969e698b6cc75 (patch)
treeefa5c227513168711732b0d14db6b09f62a21e4e /docs/ref
parent84e7fec88ddfc4178500a80d640728226d77317a (diff)
[1.8.x] 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. Backport of 1bfcc95 from master
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 98778c36ba..33057d36bd 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()``
==============