diff options
Diffstat (limited to 'python/process_queue.py')
| -rw-r--r-- | python/process_queue.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/python/process_queue.py b/python/process_queue.py index e6305a56..76049ca9 100644 --- a/python/process_queue.py +++ b/python/process_queue.py @@ -144,7 +144,7 @@ def build_line(obj, queue_name='bond_trades'): if queue_name == 'bond_trades': obj['Deal Type'] = 'MortgageDeal' obj['Portfolio'] = 'MORTGAGE' - obj['Transaction Indicator'] = "Buy" if obj.buysell else "Sell" + obj['Transaction Indicator'] = "Buy" if obj['buysell'] else "Sell" obj['Delivery'] = 'S' ## zero coupon bond if obj['CUSIP'] != obj['GlopeOp Security Identifier']: @@ -152,7 +152,7 @@ def build_line(obj, queue_name='bond_trades'): elif queue_name == 'swaption_trades': obj['Deal Type'] = 'SwaptionDeal' obj['Portfolio'] = 'OPTIONS' - obj['Transaction Indicator'] = "Buy" if obj.buysell else "Sell" + obj['Transaction Indicator'] = "Buy" if obj['buysell'] else "Sell" obj['ExerciseType'] = 'European' obj['SettlementMode'] = 'Delivery' rename_keys(obj, {'Settlement Date': 'PremiumSettlementDate', @@ -260,7 +260,7 @@ def bond_trade_process(conn, session, trade): c.execute("UPDATE bonds SET principal_payment = %s, accrued_payment = %s " "WHERE id = %s", (principal_payment, accrued_payment, int(trade['id']))) #mark it at buy price - if trade.buysell: + if trade['buysell']: sqlstr = "INSERT INTO marks VALUES(%s, %s, %s)" try: with conn: @@ -325,9 +325,9 @@ def write_buffer(buf, queue_name='bond_trades'): logging.error("Please set daily directory in DAILY_DIR") def email_subject(trade): - return "[{0}] {1} {2} {3}".format(trade.asset_class, trade.action, - "Buy" if trade.buysell else "Sell", - trade.description) + return "[{0}] {1} {2} {3}".format(trade['asset_class'], trade['action'], + "Buy" if trade['buysell'] else "Sell", + trade['description']) if __name__=="__main__": parser = argparse.ArgumentParser() |
