diff options
author | Christopher Allan Webber <cwebber@dustycloud.org> | 2013-05-15 11:11:24 -0500 |
---|---|---|
committer | Christopher Allan Webber <cwebber@dustycloud.org> | 2013-05-15 11:11:24 -0500 |
commit | 1c6d2e87f7e0051f33b043e6e0de41ee66ae304b (patch) | |
tree | 85add8efb02392bd39e9971474735010e2ce16e5 /mediagoblin/tools/template.py | |
parent | 0553976187a4ec870f944d2d4d17a4951075d2a8 (diff) | |
download | mediagoblin-1c6d2e87f7e0051f33b043e6e0de41ee66ae304b.tar.lz mediagoblin-1c6d2e87f7e0051f33b043e6e0de41ee66ae304b.tar.xz mediagoblin-1c6d2e87f7e0051f33b043e6e0de41ee66ae304b.zip |
Oh right, actually add that hook we just documented, "template_context_prerender" :)
This commit sponsored by William Goudie. Thanks Bill! :)
Diffstat (limited to 'mediagoblin/tools/template.py')
-rw-r--r-- | mediagoblin/tools/template.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/mediagoblin/tools/template.py b/mediagoblin/tools/template.py index aab571f0..3d651a6e 100644 --- a/mediagoblin/tools/template.py +++ b/mediagoblin/tools/template.py @@ -113,6 +113,13 @@ def render_template(request, template_path, context): (request.controller_name, template_path), context) + # More evil: allow plugins to possibly do something to the context + # in every request ever with access to the request and other + # variables. Note: this is slower than using + # template_global_context + context = hook_transform( + 'template_context_prerender', context) + rendered = template.render(context) if common.TESTS_ENABLED: |