当前位置: 首页>>代码示例>>Python>>正文


Python APIDB.create_indicator方法代码示例

本文整理汇总了Python中api_db_utils.APIDB.create_indicator方法的典型用法代码示例。如果您正苦于以下问题:Python APIDB.create_indicator方法的具体用法?Python APIDB.create_indicator怎么用?Python APIDB.create_indicator使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在api_db_utils.APIDB的用法示例。


在下文中一共展示了APIDB.create_indicator方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: coach_indicators_create

# 需要导入模块: from api_db_utils import APIDB [as 别名]
# 或者: from api_db_utils.APIDB import create_indicator [as 别名]
def coach_indicators_create(req, uskey_club):
    """
    ``POST`` @ |ca| +  ``/clubs/<uskey_club>/indicators``

    Creates an indicator |uroleOT|
    """
    club = req.model
    j_req = json_from_request(req, mandatory_props=['name', 'indicatorType', 'description'],
                              optional_props=['possibleAnswers', 'required'])
    indicator = APIDB.create_indicator(club, **j_req)
    return indicator.to_dict()
开发者ID:gymcentral,项目名称:gymcentral,代码行数:13,代码来源:api_coach.py

示例2: dict

# 需要导入模块: from api_db_utils import APIDB [as 别名]
# 或者: from api_db_utils.APIDB import create_indicator [as 别名]
# Course
data = dict(name="Strength and balance", description="Free course to improve your strength and balance.",
            start_date=date_to_js_timestamp(datetime(2015, 1, 1)),
            end_date=date_to_js_timestamp(datetime(2015, 12, 31)),
            course_type="SCHEDULED", max_level=2)
course = APIDB.create_course(club, **data)
APIDB.add_trainer_to_course(user, course)
# Course created
# course = Key('Course',4785074604081152).get()
# Indicators
data = dict(name="How are you today?", indicator_type="INTEGER", description="How are you today", required=True,
            answer_type='CHECKBOXES',
            possible_answers=[dict(name='1', text='Very bad', value='1'), dict(name='2', text='Not so good', value='2'),
                              dict(name='3', text='Ok', value='3'), dict(name='4', text='Good', value='4'),
                              dict(name='5', text='Very good', value='5')])
how_are_you = APIDB.create_indicator(club, **data)
# how_are_you = Key('Indicator',5275456790069248).get()
data = dict(name="How was the session?", indicator_type="INTEGER", description="How was the session", required=True,
            answer_type='CHECKBOXES',
            possible_answers=[dict(name='e', text='easy', value='-1'), dict(name='m', text='medium', value='0'),
                              dict(name='h', text='hard', value='1')])
how_was_session = APIDB.create_indicator(club, **data)
# how_was_session = Key('Indicator',6401356696911872).get()
data = dict(name="How was the exercise?", indicator_type="INTEGER", description="How was the exercise", required=True,
            answer_type='CHECKBOXES',
            possible_answers=[dict(name='e', text='easy', value='-1'), dict(name='m', text='medium', value='0'),
                              dict(name='h', text='hard', value='1')])
how_was_exercise = APIDB.create_indicator(club, **data)
# print how_was_exercise
# how_was_exercise = Key('Indicator',4993981813358592).get()
data = dict(name="Did you complete the exercise?", indicator_type="BOOLEAN", description="completed", required=True,
开发者ID:gymcentral,项目名称:gymcentral,代码行数:33,代码来源:creation_script.py


注:本文中的api_db_utils.APIDB.create_indicator方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。