def find_template(self, template_type, action_type):
"""look for template"""
potential_templates = []
if action_type:
action_type = slugify(action_type.name)
potential_templates += [
u"documents/_{0}_{1}.html".format(action_type, template_type),
]
potential_templates += [
"documents/_{0}.html".format(template_type),
]
for template_name in potential_templates:
try:
get_template(template_name)
return template_name
except TemplateDoesNotExist:
pass
return None
评论列表
文章目录