async def create_user(user: User): user_db = UserTable() user_db.name = user.name user_db.password = user.password session.add(user_db) session.commit() return user_db
def create_users(name: str, age: int): user = UserTable() user.name = name user.age = age session.add(user) session.commit() return f"{name} create.."
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...'}
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.." }
def handler(event, context): app_id = os.environ["APPID"] user_table_name = os.environ["USER_TABLE"] system_table_name = os.environ["SYSTEM_TABLE"] dynamodb = boto3.resource('dynamodb') user_table = UserTable(dynamodb.Table(user_table_name)) system_table = SystemTable(dynamodb.Table(system_table_name)) weather_client = WeatherClient(app_id) main_handler = MainRunner(user_table, system_table, UserRunnerGenerator(weather_client)) return main_handler.run()
async def create_user(name: str, age: int): user = UserTable() user.name = name user.age = age session.add(user) session.commit()