Exemplo n.º 1
0
Arquivo: main.py Projeto: sang-rak/TIL
def create_users(name: str, age: int):
    
    user = UserTable()
    user.name = name
    user.age = age
    
    session.add(user)
    session.commit()

    return f"{name} create.."
Exemplo n.º 2
0
async def create_user(users:  User):
    #data = { (id: 0), (name: uname), (age: uage)};
    userlist=list(users) #2차원배열로 변환
    uname=userlist[1][1] #user_list.html. 35번줄에서 String으로 바꿔줘서 이렇게 써야함
    uage=userlist[2][1]

    user = UserTable()
    user.name = uname
    user.age = uage

    session.add(user)
    session.commit()

    return {'result_msg', f'{uname} Registered...'}
Exemplo n.º 3
0
async def create_users(users: User):
    
    #data = {(id: 0), (name: uname), (age: uage) }:

    userlist = list(users)
    uname = userlist[1][1]
    uage = userlist[2][1]

    user = UserTable()
    user.name = uname
    user.age = uage
    
    session.add(user)
    session.commit()

    return { "result_msg", f"{name} create.." }
Exemplo n.º 4
0
async def create_user(name: str, age: int):
    user = UserTable()
    user.name = name
    user.age = age
    session.add(user)
    session.commit()