diff options
Diffstat (limited to 'python')
| -rw-r--r-- | python/Dawn/models.py | 4 | ||||
| -rw-r--r-- | python/Dawn/views.py | 3 |
2 files changed, 5 insertions, 2 deletions
diff --git a/python/Dawn/models.py b/python/Dawn/models.py index 24dc8b37..70a3cce7 100644 --- a/python/Dawn/models.py +++ b/python/Dawn/models.py @@ -171,6 +171,8 @@ class CDSDeal(db.Model): upfront_settle_date = db.Column(db.Date, nullable=False) initial_margin_percentage = db.Column(db.Float) swap_type = db.Column(SWAP_TYPE, nullable=False) + orig_attach = db.Column(db.SmallInteger, info={'min': 0, 'max': 100}) + orig_detach = db.Column(db.SmallInteger, info={'min': 0, 'max': 100}) attach = db.Column(db.Float, info={'min': 0., 'max': 100.}) detach = db.Column(db.Float, info={'min': 0., 'max': 100.}) corr_attach = db.Column(db.Float, info={'min': 0., 'max': 1.}) @@ -188,7 +190,7 @@ class CDSDeal(db.Model): termination_counterparty = db.relationship(Counterparties, foreign_keys=[termination_cp]) fcm_account = db.relationship(Accounts, foreign_keys=[account_code]) __table_args__ = (db.CheckConstraint("swap_type!='CD_INDEX_TRANCHE' or " \ - "(attach is not NULL and detach is not NULL AND " \ + "(orig_attach is not NULL and orig_detach is not NULL AND " \ "clearing_facility is NULL)"),) class RepoDeal(db.Model): diff --git a/python/Dawn/views.py b/python/Dawn/views.py index eebb2671..086d7d99 100644 --- a/python/Dawn/views.py +++ b/python/Dawn/views.py @@ -102,7 +102,8 @@ class CDSForm(ModelForm): model = CDSDeal include_foreign_keys = True exclude = ['dealid', 'lastupdate', 'termination_amount', - 'termination_cp', 'termination_date', 'custodian', 'cashaccount'] + 'termination_cp', 'termination_date', 'custodian', + 'cashaccount', 'attach', 'detach'] class SwaptionForm(ModelForm): |
