From beb6bf01463af8229fbd481e362a7edbd7f54124 Mon Sep 17 00:00:00 2001 From: lxf Date: Fri, 18 Feb 2022 11:43:11 -0500 Subject: trad: fixed list view so it only shows this year's trades --- app/trading/views.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'app/trading') diff --git a/app/trading/views.py b/app/trading/views.py index 3bb64cf..5cdcf29 100644 --- a/app/trading/views.py +++ b/app/trading/views.py @@ -30,7 +30,10 @@ class LuxTradeListView(PaginatedListView): def get_queryset(self): queryset = super(LuxTradeListView, self).get_queryset() - return queryset.filter(status=1) + queryset = queryset.filter(status=1) + start_date = datetime.date(timezone.now().year, 1, 1) + end_date = datetime.date(timezone.now().year, 12, 31) + return self.filter(close_date__range=(start_date, end_date)) class LuxTradeDetailView(UpdateView): -- cgit v1.2.3-70-g09d2