models.py 文件源码

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

项目:zing 作者: evernote 项目源码 文件源码
def delete(self, *args, **kwargs):
        directory = self.directory

        # Just doing a plain delete will collect all related objects in memory
        # before deleting: translation projects, stores, units, quality checks,
        # suggestions, and submissions.
        # This can easily take down a process. If we do a translation project
        # at a time and force garbage collection, things stay much more
        # managable.
        import gc
        gc.collect()
        for tp in self.translationproject_set.iterator():
            tp.delete()
            gc.collect()

        super(Project, self).delete(*args, **kwargs)

        directory.delete()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号