models.py 文件源码

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

项目:zing 作者: evernote 项目源码 文件源码
def invalidate_resources_cache(**kwargs):
    instance = kwargs["instance"]
    if instance.__class__.__name__ not in ['Directory', 'Store']:
        return

    # Don't invalidate if the save didn't create new objects
    no_new_objects = (
        ('created' in kwargs
         and 'raw' in kwargs)
        and (not kwargs['created']
             or kwargs['raw']))

    if no_new_objects and instance.parent.get_children():
        return

    proj_code = split_pootle_path(instance.pootle_path)[1]
    if proj_code is not None:
        cache.delete(make_method_key(Project, 'resources', proj_code))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号