本文整理汇总了Python中gae_bingo.cache.BingoCache.load_from_datastore方法的典型用法代码示例。如果您正苦于以下问题:Python BingoCache.load_from_datastore方法的具体用法?Python BingoCache.load_from_datastore怎么用?Python BingoCache.load_from_datastore使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gae_bingo.cache.BingoCache
的用法示例。
在下文中一共展示了BingoCache.load_from_datastore方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get_experiments
# 需要导入模块: from gae_bingo.cache import BingoCache [as 别名]
# 或者: from gae_bingo.cache.BingoCache import load_from_datastore [as 别名]
def get_experiments(self, archives=False):
if archives:
bingo_cache = BingoCache.load_from_datastore(archives=True)
else:
bingo_cache = BingoCache.get()
return str(bingo_cache.experiments)
示例2: delete_all_experiments
# 需要导入模块: from gae_bingo.cache import BingoCache [as 别名]
# 或者: from gae_bingo.cache.BingoCache import load_from_datastore [as 别名]
def delete_all_experiments(self):
bingo_cache = BingoCache.get()
for experiment_name in bingo_cache.experiments.keys():
bingo_cache.delete_experiment_and_alternatives(bingo_cache.get_experiment(experiment_name))
bingo_cache_archives = BingoCache.load_from_datastore(archives=True)
for experiment_name in bingo_cache_archives.experiments.keys():
bingo_cache_archives.delete_experiment_and_alternatives(
bingo_cache_archives.get_experiment(experiment_name)
)
return len(bingo_cache.experiments) + len(bingo_cache_archives.experiments)