diff options
Diffstat (limited to 'python/Dawn')
| -rw-r--r-- | python/Dawn/views.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/python/Dawn/views.py b/python/Dawn/views.py index fae7914a..a609763c 100644 --- a/python/Dawn/views.py +++ b/python/Dawn/views.py @@ -44,12 +44,15 @@ def trade_manage(tradeid): trade = BondDeal.query.get(tradeid) if tradeid else BondDeal() if tradeid: bond_form = BondForm(obj = trade) - bond_form.action.choices = [('UPDATE', 'UPDATE'), ('CANCEL', 'CANCEL')] + #change default to UPDATE + bond_form.action.default='UPDATE' old_ticket_name = trade.ticket else: bond_form = BondForm(trade_date = pd.datetime.today().date(), settle_date = pd.datetime.today().date() + 3 * BDay()) - bond_form.cp_code.choices = cp_choices() + bond_form.buysell.choices = [(None, '')] + bond_form.buysell.choices + bond_form.assetclass = [(None, '')] + bond_form.asset_class.choices + bond_form.cp_code.choices = bond_form.cp_code.choices + list(cp_choices()) if bond_form.is_submitted(): if bond_form.validate(): bond_form.populate_obj(trade) |
