def notmain(): '''Run some local code''' q = TradeSum.getById(1786) print(q.shares) dbdr = DbDoctorCrud() qq = dbdr.getTradeSumById(1786)
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
def getTradeSumById(self, tsid): return TradeSum.getById(tsid)