mixins.py 文件源码

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

项目:ecs_sclm 作者: meaningful 项目源码 文件源码
def icons(self):
        r = {}
        if getattr(self, '_icon', False):
            for size in FILER_ADMIN_ICON_SIZES:
                try:
                    r[size] = static("filer/icons/%s_%sx%s.png" % (
                        self._icon, size, size))
                except ValueError:
                    # Do not raise an exception while trying to call static()
                    # on non-existent icon file. This avoids the issue with
                    # rendering parts of the template as empty blocks that
                    # happens on an attempt to access object 'icons' attribute
                    # in template.
                    pass
        return r
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号