Ejemplo n.º 1
0
def get_scenes():
    try:
        scenes = com_gets(Scene)
    except Exception as e:
        current_app.logger.error("[scene][gets] fail expection: {}".format(e))
        return InvalidMessage(str(e), 500)
    datas = model_helper.obj_list_to_list_dict(scenes)
    return return_data(datas, 200)
Ejemplo n.º 2
0
def get_labels():
    try:
        labels = com_gets(Label)
    except Exception as e:
        current_app.logger.error("[label][gets] fail expection: {}".format(e))
        return InvalidMessage(str(e), 500)
    datas = model_helper.obj_list_to_list_dict(labels)
    return return_data(datas, 200)
Ejemplo n.º 3
0
def get_user_heads():
    try:
        user_heads = com_gets(UserHead)
    except Exception as e:
        current_app.logger.error(
            "[user_head][gets] fail expection: {}".format(e))
        return InvalidMessage(str(e), 500)
    datas = model_helper.obj_list_to_list_dict(user_heads)
    return return_data(datas, 200)
Ejemplo n.º 4
0
def get_papers():
    try:
        papers = com_gets(Paper)
    except Exception as e:
        current_app.logger.error("[paper][gets] fail expection: {}".format(e))
        return InvalidMessage(str(e), 500)
    datas = []
    for paper in papers:
        datas.append(paper_helper.make_paper_reponse_body(paper))
    return return_data(datas, 200)
Ejemplo n.º 5
0
def get_heads():
    try:
        heads = com_gets(Head)
    except Exception as e:
        current_app.logger.error("[head][gets] fail expection: {}".format(e))
        return InvalidMessage(str(e), 500)
    datas = []
    for head in heads:
        datas.append(paper_helper.make_head_reponse_body(head))
    return return_data(datas, 200)
Ejemplo n.º 6
0
def get_subjects():
    try:
        subjects = com_gets(Subject)
    except Exception as e:
        current_app.logger.error("[subject][gets] fail expection: {}".format(e))
        return InvalidMessage(str(e), 500)
    datas = []
    for subject in subjects:
        data = paper_helper.make_subject_reponse_body(subject)
        datas.append(data)
    return return_data(datas, 200)
Ejemplo n.º 7
0
def get_roles():
    try:
        roles = com_gets(Role)
    except Exception as e:
        current_app.logger.error("[role][gets] fail expection: {}".format(e))
        raise InvalidMessage(str(e), 500)
    datas = []
    for role in roles:
        data = user_helper.make_role_reponse_body(role)
        datas.append(data)
    return return_data(datas, 200)
Ejemplo n.º 8
0
def get_groups():
    try:
        groups = com_gets(Group)
    except Exception as e:
        current_app.logger.error("[group][gets] fail expection: {}".format(e))
        raise InvalidMessage(str(e), 500)
    datas = []
    for group in groups:
        data = user_helper.make_role_reponse_body(group)
        datas.append(data)
    return return_data(datas, 200)
Ejemplo n.º 9
0
def get_users():
    try:
        users = com_gets(User)
    except Exception as e:
        current_app.logger.error("[user][gets] fail expection: {}".format(e))
        raise InvalidMessage(str(e), 500)
    datas = []
    for user in users:
        data = user_helper.make_user_reponse_body(user)
        datas.append(data)
    return return_data(datas, 200)