fix new-style template replacement; support cond rendering

This commit is contained in:
Damien Elmes 2011-01-13 20:00:35 +09:00
parent cdcde2f2d3
commit 149fbee33e

View file

@ -1815,9 +1815,12 @@ update facts set modified = :t where modelId = :mid"""
for cm in model.cardModels: for cm in model.cardModels:
types = ("%%(%s)s", types = ("%%(%s)s",
"%%(text:%s)s", "%%(text:%s)s",
# new style # new styles
"<<%s>>", "{{%s}}",
"<<text:%s>>") "{{text:%s}}",
"{{# %s}}",
"{{^ %s}}",
"{{/ %s}}")
for t in types: for t in types:
for fmt in ('qformat', 'aformat'): for fmt in ('qformat', 'aformat'):
setattr(cm, fmt, getattr(cm, fmt).replace(t%field.name, setattr(cm, fmt, getattr(cm, fmt).replace(t%field.name,