def delete(): myRes = MyResponse() USER_KEY = MyRequest.get("USER_KEY", type=int) try: MySqlalchemy.comDel(UserInfo, [UserInfo.USER_KEY == USER_KEY]) myRes.code = ResState.HTTP_SUCCESS myRes.msg = "操作成功" except SQLAlchemyError as ex: mylog.error(ex) myRes.msg = ResState.ERROR_DB return myRes.to_json()
def delete(): myRes = MyResponse() ROLE_KEY = MyRequest.get("ROLE_KEY", type=int) try: MySqlalchemy.comDel(RoleInfo, [RoleInfo.ROLE_KEY == ROLE_KEY]) myRes.code = ResState.HTTP_SUCCESS myRes.msg = "操作成功" except SQLAlchemyError as ex: db_session.rollback() mylog.error(ex) myRes.msg = str(ex) finally: db_session.close() return myRes.to_json()