documents.py 文件源码

python
阅读 24 收藏 0 点赞 0 评论 0

项目:balafon 作者: ljean 项目源码 文件源码
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
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号