[ckan-changes] [okfn/ckan] d3eb51: [xs] allow render_snippet and render_text to pass ...
GitHub
noreply at github.com
Tue Apr 24 14:36:51 UTC 2012
Branch: refs/heads/master
Home: https://github.com/okfn/ckan
Commit: d3eb51a89a5e4546c4beb09ccd358ebfd8d720fa
https://github.com/okfn/ckan/commit/d3eb51a89a5e4546c4beb09ccd358ebfd8d720fa
Author: Toby <toby.junk at gmail.com>
Date: 2012-04-24 (Tue, 24 Apr 2012)
Changed paths:
M ckan/lib/base.py
Log Message:
-----------
[xs] allow render_snippet and render_text to pass cache_force keyword
diff --git a/ckan/lib/base.py b/ckan/lib/base.py
index dd1f03b..ffb79a7 100644
--- a/ckan/lib/base.py
+++ b/ckan/lib/base.py
@@ -53,16 +53,19 @@ def render_snippet(template_name, **kw):
comment tags added to show the template used. NOTE: unlike other
render functions this takes a list of keywords instead of a dict for
the extra template variables. '''
- output = render(template_name, extra_vars=kw)
+ # allow cache_force to be set in render function
+ cache_force = kw.pop('cache_force', None)
+ output = render(template_name, extra_vars=kw, cache_force=cache_force)
output = '\n<!-- Snippet %s start -->\n%s\n<!-- Snippet %s end -->\n' % (
template_name, output, template_name)
return literal(output)
-def render_text(template_name, extra_vars=None):
+def render_text(template_name, extra_vars=None, cache_force=None):
''' Helper function to render a genshi NewTextTemplate without
having to pass the loader_class or method. '''
return render(template_name,
extra_vars=extra_vars,
+ cache_force=cache_force,
method='text',
loader_class=NewTextTemplate)
================================================================
More information about the ckan-changes
mailing list