diff options
author | Eric Florenzano <floguy@gmail.com> | 2009-10-29 02:22:48 -0700 |
---|---|---|
committer | Eric Florenzano <floguy@gmail.com> | 2009-10-29 02:22:48 -0700 |
commit | 43cb2c22bc121d397cd6136a6dfbaa5fc244fa03 (patch) | |
tree | 3cafc30d12665e02ef67c6f88a1aab8e3a457c68 | |
parent | 68f7cca57911f2f0a219d5a478f53e3c7b29c2ef (diff) | |
download | pystache-43cb2c22bc121d397cd6136a6dfbaa5fc244fa03.tar.gz |
More compact render_tag
-rw-r--r-- | pystache/template.py | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/pystache/template.py b/pystache/template.py index 8d87cd9..317e0a6 100644 --- a/pystache/template.py +++ b/pystache/template.py @@ -60,10 +60,7 @@ class Template(object): def render_tag(self, tag_name, context): """Given a tag name and context, finds and renders the tag.""" - if tag_name in context: - return context[tag_name] - else: - return '' + return context.get(tag_name, '') def render_comment(self, tag_name=None, context=None): """Rendering a comment always returns nothing.""" |