Esempio n. 1
0
def create():
    session.rollback()
    data = deepcopy(request.data)
    data.update({"created_by_id": request.user["id"]})
    result = query_helper.save(session, BoardUser, data, json_result=True)
    log_helper.log_insert(session, BoardUser, request.user["id"], result)
    session.commit()
    return json_dumps(model_helper.insert_field_objects(session, result))
Esempio n. 2
0
def create():
    session.rollback()
    result = query_helper.save(session,
                               CardList,
                               request.data,
                               json_result=True)
    log_helper.log_insert(session, CardList, request.user["id"], result)
    session.commit()
    return json_dumps(model_helper.insert_field_objects(session, result))
Esempio n. 3
0
def signup():
    session.rollback()
    data = deepcopy(request.data)
    data.update({
        "created_at": datetime.utcnow(),
        "created_by_id": request.user["id"]
    })
    if 'password' in data:
        data['password'] = password_helper.encrypt_password(
            str(data['password']).strip())

    result = query_helper.save(session, User, data, json_result=True)
    log_helper.log_insert(session, User, request.user["id"], result)
    session.commit()
    return json_dumps(model_helper.insert_field_objects(session, result))