本文整理汇总了Python中api_db_utils.APIDB.create_performance方法的典型用法代码示例。如果您正苦于以下问题:Python APIDB.create_performance方法的具体用法?Python APIDB.create_performance怎么用?Python APIDB.create_performance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类api_db_utils.APIDB
的用法示例。
在下文中一共展示了APIDB.create_performance方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: trainee_session_performance
# 需要导入模块: from api_db_utils import APIDB [as 别名]
# 或者: from api_db_utils.APIDB import create_performance [as 别名]
def trainee_session_performance(req, uskey_session):
"""
``POST`` @ |ta| + ``/sessions/<uskey_session>/performances``
Post the performance of the session
"""
participation = json_from_request(req, mandatory_props=['joinTime', 'leaveTime', 'indicators',
'activityPerformances', 'completeness'])
performances = participation.pop('activity_performances')
# check the data from here. probably the particaipation goes into the creation
participation = APIDB.create_participation(req.user, req.model, **participation)
for performance in performances:
APIDB.create_performance(participation, performance['activityId'], performance['completeness'],
performance['recordDate'], performance['indicators'])
return HttpCreated()