本文整理汇总了Python中api_db_utils.APIDB.create_activity方法的典型用法代码示例。如果您正苦于以下问题:Python APIDB.create_activity方法的具体用法?Python APIDB.create_activity怎么用?Python APIDB.create_activity使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类api_db_utils.APIDB
的用法示例。
在下文中一共展示了APIDB.create_activity方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: coach_club_activities_create
# 需要导入模块: from api_db_utils import APIDB [as 别名]
# 或者: from api_db_utils.APIDB import create_activity [as 别名]
def coach_club_activities_create(req, uskey_club):
"""
``POST`` @ |ca| + ``/clubs/<uskey_club>/activities``
Creates an activity for a club. |uroleOT|
"""
club = req.model
# TODO: add indicators here...
j_req = json_from_request(req, mandatory_props=['name'], optional_props=['indicators'])
activity = APIDB.create_activity(club, **j_req)
req.model = activity
return coach_activities_detail(req, None)
示例2: dict
# 需要导入模块: from api_db_utils import APIDB [as 别名]
# 或者: from api_db_utils.APIDB import create_activity [as 别名]
levels=[dict(level_number=1,
description="Stand up tall beside the bench. Hold on the bench. Keep exercising leg straight and the foot straight forward. Lift the leg out to the side and return. Repeat as in the video.",
name='level 1',
source=dict(source_type='VIDEO',
hd_link='https://player.vimeo.com/external/113606171.hd.mp4?s=5d816b387f9c9995cf78023011c54c5b&profile_id=113',
http_live_streaming='https://player.vimeo.com/external/113606171.m3u8?p=high,standard,mobile&s=423466cb08dd0e8ac05a2ab9420a5d1b')
),
dict(level_number=2,
description="Strap the weight on your ankle. Stand up tall beside the bench. Hold on the bench. Keep exercising leg straight and the foot straight forward. Lift the leg out to the side and return. Repeat as in the video.",
name='level 2',
source=dict(source_type='VIDEO',
hd_link='https://player.vimeo.com/external/113606172.hd.mp4?s=d9038e766016ace802f6ebd7c885f2e4&profile_id=113',
http_live_streaming='https://player.vimeo.com/external/113606172.m3u8?p=high,standard,mobile&s=545bb72cb42b37ca888a71ccb7591fb2')
)
])
first_ex = APIDB.create_activity(club, **data)
# first_ex = Key('Exercise',6682831673622528).get()
data = dict(
name="2 Back knee strenghting",
indicators=[how_was_exercise.id, completed.id],
levels=[
dict(
level_number=1,
description="Stand up tall facing the bench with both hands on the bench. Bend the knee, bringing the foot towards your bottom. Repeat as in the video.",
name='level 1',
source=dict(
source_type='VIDEO',
hd_link='https://player.vimeo.com/external/113606956.hd.mp4?s=08caa2b8fc294e2b69da65d57db6908a&profile_id=113',
http_live_streaming='https://player.vimeo.com/external/113606956.m3u8?p=high,standard,mobile&s=ee04a8e522638efef5cea7e7f3c5e52e',
instruction_link='https://player.vimeo.com/external/106816948.sd.mp4?s=0c14f94af62066f31c42d1d721f54282&profile_id=112'
)