def insert_trade_history(session, request_nonce, amount, order_id): session.add( LiquidEmaTradeHistory( order_request_nonce=request_nonce, amount=amount, status="request", open_order_id=order_id, created_at=datetime.now().strftime("%Y-%m-%d %H:%M:%S"), updated_at=datetime.now().strftime("%Y-%m-%d %H:%M:%S"))) session.commit()
def signin(datas): try: session.query(Users).filter_by(user_name=datas['user_name']).one() except: session.add( Users(user_name=datas['user_name'], user_password=datas['user_password'], created_at=datetime.datetime.now())) session.commit() return 1 return 0