Commit de9f7d41 by Yuest Wang

Inverted Sections For Empty List

parent feb339da
...@@ -89,7 +89,7 @@ class Template(object): ...@@ -89,7 +89,7 @@ class Template(object):
elif it and hasattr(it, 'keys') and hasattr(it, '__getitem__'): elif it and hasattr(it, 'keys') and hasattr(it, '__getitem__'):
if section[2] != '^': if section[2] != '^':
replacer = self.render(inner, it) replacer = self.render(inner, it)
elif it: elif it and section[2] != '^':
insides = [] insides = []
for item in it: for item in it:
insides.append(self.render(inner, item)) insides.append(self.render(inner, item))
...@@ -154,4 +154,4 @@ class Template(object): ...@@ -154,4 +154,4 @@ class Template(object):
"""Changes the Mustache delimiter.""" """Changes the Mustache delimiter."""
self.otag, self.ctag = tag_name.split(' ') self.otag, self.ctag = tag_name.split(' ')
self.compile_regexps() self.compile_regexps()
return '' return ''
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment