From 3602afb7d17d21ab9437ef3ac6443617f100cf08 Mon Sep 17 00:00:00 2001 From: lxf Date: Wed, 16 Mar 2022 10:35:37 -0400 Subject: trad: reformatted the list view to make it easier to see monthly yearly stats --- app/trading/templates/trading/list.html | 35 +++++++++++++++++++++++++++++++-- app/trading/views.py | 2 +- 2 files changed, 34 insertions(+), 3 deletions(-) (limited to 'app/trading') diff --git a/app/trading/templates/trading/list.html b/app/trading/templates/trading/list.html index 0fdc03d..3063533 100644 --- a/app/trading/templates/trading/list.html +++ b/app/trading/templates/trading/list.html @@ -1,7 +1,7 @@ {% extends 'trading/base.html' %} {% block content %} -

WON Options Trades

+

Options

@@ -149,7 +149,7 @@ -

Open Stock Trades

+

Stocks

@@ -221,6 +221,37 @@ {% endfor %} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 
{{month}} P/L:{{monthly_pl.pl__sum}}
YTD P/L:{{year_pl.pl__sum}}
diff --git a/app/trading/views.py b/app/trading/views.py index 86556f3..82904ca 100644 --- a/app/trading/views.py +++ b/app/trading/views.py @@ -31,7 +31,7 @@ class LuxTradeListView(PaginatedListView): context['options_monthly_pl'] = LuxOptionPurchase.stats.get_month_pl() context['options_year_pl'] = LuxOptionPurchase.stats.get_year_pl() context['month'] = timezone.now().strftime('%h') - context['luxoptions_purchases'] = LuxOptionPurchase.objects.all() + context['luxoptions_purchases'] = LuxOptionPurchase.objects.filter(close_date__range=(start_date, end_date)) return context def get_queryset(self): -- cgit v1.2.3-70-g09d2