summaryrefslogtreecommitdiff
path: root/app/trading
diff options
context:
space:
mode:
authorlxf <sng@luxagraf.net>2022-02-18 11:43:11 -0500
committerlxf <sng@luxagraf.net>2022-02-18 11:44:54 -0500
commitbeb6bf01463af8229fbd481e362a7edbd7f54124 (patch)
treeb9ade4be8442a7945090299da75aecc79ded0ad9 /app/trading
parentd9dabc241827dd86d2d66437c9e517623ed62b68 (diff)
trad: fixed list view so it only shows this year's trades
Diffstat (limited to 'app/trading')
-rw-r--r--app/trading/views.py5
1 files changed, 4 insertions, 1 deletions
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):