本文整理汇总了Python中database.DatabaseManager.retrieve_performance_chain方法的典型用法代码示例。如果您正苦于以下问题:Python DatabaseManager.retrieve_performance_chain方法的具体用法?Python DatabaseManager.retrieve_performance_chain怎么用?Python DatabaseManager.retrieve_performance_chain使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类database.DatabaseManager
的用法示例。
在下文中一共展示了DatabaseManager.retrieve_performance_chain方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: citation_page
# 需要导入模块: from database import DatabaseManager [as 别名]
# 或者: from database.DatabaseManager import retrieve_performance_chain [as 别名]
def citation_page(uuid):
game_ref = dbm.retrieve_game_ref(uuid)
perf_ref = dbm.retrieve_perf_ref(uuid)
derived_performances = dbm.retrieve_derived_performances(uuid)
previous_performances = dbm.retrieve_performance_chain(uuid)[:-1]
save_states = dbm.retrieve_save_state(game_uuid=uuid)
extra_files = dbm.retrieve_file_path(game_uuid=uuid)
if game_ref:
return render_template('citation.html',
citeref=game_ref,
is_game=True,
is_performance=False,
derived_performances=derived_performances,
extra_files=extra_files,
save_states=save_states)
elif perf_ref:
performance_video = "/cite_data/{}/{}".format(perf_ref['replay_source_file_ref'],
perf_ref['replay_source_file_name'])
return render_template('citation.html',
citeref=perf_ref,
is_game=False,
is_performance=True,
previous_performances=previous_performances,
performance_video=performance_video)
return "No record found, sorry."
示例2: make_performance_package
# 需要导入模块: from database import DatabaseManager [as 别名]
# 或者: from database.DatabaseManager import retrieve_performance_chain [as 别名]
def make_performance_package(performance):
pack = {}
game = dbm.retrieve_game_ref(performance['game_uuid'])
pack['game'] = game.elements if game else None
pack['performance'] = performance.elements
# Last performance is current performance
pack['previous_performances'] = [i.elements for i in dbm.retrieve_performance_chain(performance['uuid'])[:-1]]
return pack