コード例 #1
0
def find(board_user_id: str):
    session.rollback()
    result = query_helper.find_by_id(session,
                                     BoardUser,
                                     board_user_id,
                                     json_result=True)
    return json_dumps(model_helper.insert_field_objects(session, result))
コード例 #2
0
ファイル: card_list.py プロジェクト: etsalah/taskhog
def find(card_list_id: str):
    session.rollback()
    result = query_helper.find_by_id(session,
                                     CardList,
                                     card_list_id,
                                     json_result=True)
    return json_dumps(model_helper.insert_field_objects(session, result))
コード例 #3
0
def insert_field_objects(session_obj, obj_dict: dict):
    mapped_columns = FIELD_MODEL_MAPPING.keys()

    for column in mapped_columns:
        if column in obj_dict:
            if obj_dict[column]:
                label = FIELD_MODEL_MAPPING[column]["label"]
                cls = FIELD_MODEL_MAPPING[column]["cls"]
                obj_dict[label] = query_helper.find_by_id(session_obj,
                                                          cls,
                                                          obj_dict[column],
                                                          json_result=True)

    return obj_dict
コード例 #4
0
def setup_admin_account(_id):

    if not query_helper.find_by_id(session, User, _id):
        query_helper.save(
            session, User, {
                "id":
                _id,
                "email":
                "*****@*****.**",
                "username":
                "******",
                "password":
                password_helper.encrypt_password(str("password").strip()),
                "created_by_id":
                _id,
                "created_at":
                datetime.utcnow()
            })
        session.commit()
コード例 #5
0
async def find_user(request, session_obj, user_obj, user_id):
    result = query_helper.find_by_id(session_obj, User, user_id, True)
    return json(result)
コード例 #6
0
def find(user_id):
    result = query_helper.find_by_id(session, User, user_id, json_result=True)
    return json_dumps(model_helper.insert_field_objects(session, result))