aboutsummaryrefslogtreecommitdiffstats
path: root/python
diff options
context:
space:
mode:
Diffstat (limited to 'python')
-rw-r--r--python/Dawn/views.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/python/Dawn/views.py b/python/Dawn/views.py
index a3b40ee6..13bb8032 100644
--- a/python/Dawn/views.py
+++ b/python/Dawn/views.py
@@ -484,9 +484,10 @@ def trade_manage(tradeid, kind):
)
-@app.route("/", defaults={"kind": "bond"})
-@app.route("/<kind>")
-def list_trades(kind):
+@app.route("/", defaults={"kind": "bond", "fund": None})
+@app.route("/<kind>/<fund>")
+@app.route("/<kind>", defaults={"fund": None})
+def list_trades(kind, fund):
try:
Deal = get_deal(kind)
except RuntimeError as e:
@@ -495,6 +496,8 @@ def list_trades(kind):
else:
if kind not in ["cds", "swaption"]:
trade_list = Deal.query.order_by(Deal.trade_date.desc(), Deal.id.desc())
+ if fund is not None:
+ trade_list = trade_list.filter(Deal.fund == fund)
else:
trade_list = db.session.execute(f"SELECT * FROM {kind}_trades")
return render_template(f"{kind}_blotter.html", trades=trade_list)