Example #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)
Example #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)
Example #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)
Example #4
0
    def query_all(self):
        with dataSource.session_ctx() as session:
            strategy_dbs = session.query(Strategy).all()

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

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

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

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