aboutsummaryrefslogtreecommitdiffstats
path: root/python/Dawn/views.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/Dawn/views.py')
-rw-r--r--python/Dawn/views.py27
1 files changed, 1 insertions, 26 deletions
diff --git a/python/Dawn/views.py b/python/Dawn/views.py
index 77f90acc..1149b078 100644
--- a/python/Dawn/views.py
+++ b/python/Dawn/views.py
@@ -36,20 +36,12 @@ from .models import (
from sqlalchemy.exc import IntegrityError
from wtforms.fields import BooleanField
-from pandas.tseries.offsets import CustomBusinessDay
-from pandas.tseries.holiday import get_calendar, HolidayCalendarFactory, GoodFriday
-from pyisda.date import previous_twentieth
-
from .utils import bump_rev, simple_serialize
from PyPDF2 import PdfFileMerger
from io import BytesIO
from . import app
from . import db
-fed_cal = get_calendar("USFederalHolidayCalendar")
-bond_cal = HolidayCalendarFactory("BondCalendar", fed_cal, GoodFriday)
-bus_day = CustomBusinessDay(calendar=bond_cal())
-
def cp_choices(kind="bond"):
if kind == "bond":
@@ -226,24 +218,7 @@ def get_form(trade, kind):
if trade.id:
form = Form(obj=trade)
else:
- today = pd.datetime.today()
- tomorrow = today + pd.DateOffset(1)
- if kind == "cds":
- form = Form(
- trade_date=today.date(),
- effective_date=previous_twentieth(today.date()),
- upfront_settle_date=today.date() + 1 * bus_day,
- )
-
- elif kind == "swaption":
- form = Form(
- trade_date=today.date(),
- effective_date=tomorrow.date(),
- settle_date=today.date() + 3 * bus_day,
- )
-
- else:
- form = Form(trade_date=today.date(), settle_date=today.date() + 2 * bus_day)
+ form = Form()
# add extra empty fields
empty_choice = (None, "")
for attr in ["folder", "buysell", "asset_class", "swaption_type"]: