def query_by_code(self, strategy_code, code): with dataSource.session_ctx() as session: position_dbs = session.query(Position).filter( Position.strategy_code == strategy_code, Position.code == code).first() return copy.deepcopy(position_dbs)
def query_by_code(self, strategy_code, code): with dataSource.session_ctx() as session: target_dbs = session.query(Target).filter( Target.strategy_code == strategy_code, Target.code == code).first() return copy.deepcopy(target_dbs)
def query_by_id(self, id): with dataSource.session_ctx() as session: position_dbs = session.query(Position).filter( Position.id == id).first() return copy.deepcopy(position_dbs)
def query_all(self): with dataSource.session_ctx() as session: strategy_dbs = session.query(Strategy).all() return copy.deepcopy(strategy_dbs)
def query_all(self): with dataSource.session_ctx() as session: stock_dbs = session.query(Stock_Pool).all() return copy.deepcopy(stock_dbs)
def query_by_code(self, code): with dataSource.session_ctx() as session: stock_dbs = session.query(Stock).filter(Stock.code == code).one() return copy.deepcopy(stock_dbs)
def add(self, position): with dataSource.session_ctx() as session: session.add(position)
def query_all(self): with dataSource.session_ctx() as session: position_dbs = session.query(Position).all() return copy.deepcopy(position_dbs)
def delete(self, position): with dataSource.session_ctx() as session: session.delete(position)
def update(self, position): with dataSource.session_ctx() as session: session.merge(position)
def delete(self, target): with dataSource.session_ctx() as session: session.delete(target)
def update(self, target): with dataSource.session_ctx() as session: session.merge(target)
def add(self, target): with dataSource.session_ctx() as session: session.add(target)