aboutsummaryrefslogtreecommitdiffstats
path: root/lib/mako/template.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2008-09-27 14:55:07 +0000
committerMike Bayer <mike_mp@zzzcomputing.com>2008-09-27 14:55:07 +0000
commit041b60f5e61e24f2e154a0ff6df5b663306d8735 (patch)
treeef8c53a2d74c5462d5cb83c8c3efdb9fec1e99fa /lib/mako/template.py
parent8239d75ee8c1bde874e2a448c4d00226c28e7fd7 (diff)
downloadexternal_python_mako-041b60f5e61e24f2e154a0ff6df5b663306d8735.tar.gz
external_python_mako-041b60f5e61e24f2e154a0ff6df5b663306d8735.tar.bz2
external_python_mako-041b60f5e61e24f2e154a0ff6df5b663306d8735.zip
- added "cache" accessor to Template, Namespace.
e.g. ${local.cache.get('somekey')} or template.cache.invalidate_body() - the Cache object now supports invalidate_def(name), invalidate_body(), invalidate_closure(name), invalidate(key), which will remove the given key from the cache, if it exists. The cache arguments (i.e. storage type) are derived from whatever has been already persisted for that template. [ticket:92]
Diffstat (limited to 'lib/mako/template.py')
-rw-r--r--lib/mako/template.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/mako/template.py b/lib/mako/template.py
index eea7c40..d50eb8a 100644
--- a/lib/mako/template.py
+++ b/lib/mako/template.py
@@ -117,6 +117,10 @@ class Template(object):
return _get_module_info_from_callable(self.callable_).code
code = property(code)
+ def cache(self):
+ return self.module._template_cache
+ cache = property(cache)
+
def render(self, *args, **data):
"""render the output of this template as a string.