models.py 文件源码

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

项目:kuzgun.io 作者: yigitgenc 项目源码 文件源码
def __init__(self, *args, **kwargs):
        """
        Set name, ext and content_type (if possible) automatically initialize by path.
        """
        super(File, self).__init__(*args, **kwargs)
        pieces = os.path.splitext(os.path.basename(str(self.path)))
        self.name, self.ext = pieces[0], pieces[1][1:]
        self.content_type = mimetypes.guess_type(self.full_path)[0]
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号