def delete(self, paths):
"""See L{TagAPI.delete}.
Permissions for deleted L{Tag}s are removed from the cache.
"""
if isgenerator(paths):
paths = list(paths)
# FIXME getObjectIDs is called twice--once here and once in
# TagAPI.delete. It would be better if we only did this once, not to
# mention that this breaks encapsulation by bypassing the model layer
# and accessing the data layer directly. -jkakar
objectIDs = set(getObjectIDs(paths))
RecentObjectActivityCache().clear(objectIDs)
usernames = set([path.split('/')[0] for path in paths])
RecentUserActivityCache().clear(usernames)
PermissionCache().clearTagPermissions(paths)
return self._api.delete(paths)
评论列表
文章目录