예제 #1
0
def notmain():
    '''Run some local code'''
    q = TradeSum.getById(1786)
    print(q.shares)

    dbdr = DbDoctorCrud()
    qq = dbdr.getTradeSumById(1786)
예제 #2
0
 def getTradeSumById(self, tid):
     q = TradeSum.getById(tid)
     if not q:
         return q
     # TODO
     # Unfortunately, formatting to match the old interface. Definitely fix later
     t = dict()
     t['id'] = q.id
     t['name'] = q.name
     t['strat'] = q.strategy
     t['accnt'] = q.account
     t['pl'] = q.pnl
     t['start'] = q.start
     t['date'] = q.date
     t['dur'] = q.duration
     t['qty'] = q.shares
     return t
예제 #3
0
 def getTradeSumById(self, tsid):
     return TradeSum.getById(tsid)