Esempio n. 1
0
    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)
Esempio n. 2
0
    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)
Esempio n. 3
0
    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)
Esempio n. 4
0
    def query_all(self):
        with dataSource.session_ctx() as session:
            strategy_dbs = session.query(Strategy).all()

            return copy.deepcopy(strategy_dbs)
Esempio n. 5
0
    def query_all(self):
        with dataSource.session_ctx() as session:
            stock_dbs = session.query(Stock_Pool).all()

            return copy.deepcopy(stock_dbs)
Esempio n. 6
0
    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)
Esempio n. 7
0
 def add(self, position):
     with dataSource.session_ctx() as session:
         session.add(position)
Esempio n. 8
0
    def query_all(self):

        with dataSource.session_ctx() as session:
            position_dbs = session.query(Position).all()

            return copy.deepcopy(position_dbs)
Esempio n. 9
0
 def delete(self, position):
     with dataSource.session_ctx() as session:
         session.delete(position)
Esempio n. 10
0
 def update(self, position):
     with dataSource.session_ctx() as session:
         session.merge(position)
Esempio n. 11
0
 def delete(self, target):
     with dataSource.session_ctx() as session:
         session.delete(target)
Esempio n. 12
0
 def update(self, target):
     with dataSource.session_ctx() as session:
         session.merge(target)
Esempio n. 13
0
 def add(self, target):
     with dataSource.session_ctx() as session:
         session.add(target)