def get_ids_to_read(self, *fields):
""" Return list of ids, that have no at least one of specified
fields in cache
For example::
cache.get_ids_to_read('name', 'country_id', 'parent_id')
This code will traverse all record ids managed by this cache,
and find those that have no at least one field in cache.
This is highly useful in prefetching
"""
return [key for key, val in six.viewitems(self)
if any(((field not in val) for field in fields))]
评论列表
文章目录