summaryrefslogtreecommitdiff
path: root/app/deals/views.py
diff options
context:
space:
mode:
authorluxagraf <sng@luxagraf.net>2023-11-10 10:56:32 -0500
committerluxagraf <sng@luxagraf.net>2023-11-10 10:56:32 -0500
commitda500a836a753a5d7eb286aba30d2660a0a7e7fd (patch)
tree275244edff40d424bfdac2c35f3f7c7c473611ed /app/deals/views.py
parent6fd1d244ed604df14de86a33c3298cca5da510c6 (diff)
Deals: brought up to speed with BF deals tables
Diffstat (limited to 'app/deals/views.py')
-rw-r--r--app/deals/views.py13
1 files changed, 12 insertions, 1 deletions
diff --git a/app/deals/views.py b/app/deals/views.py
index bf0a4c8..8bd01e3 100644
--- a/app/deals/views.py
+++ b/app/deals/views.py
@@ -1,7 +1,7 @@
from django.views.generic import DetailView, ListView
from django.views.generic.base import TemplateView
-from .models import Deal, MyDeal
+from .models import Deal, MyDeal, REIDeal
class DealDetailView(DetailView):
@@ -9,6 +9,7 @@ class DealDetailView(DetailView):
class MyDealListView(ListView):
model = MyDeal
+ queryset = MyDeal.objects.filter(added=False)
class MyDealLapListView(ListView):
model = MyDeal
@@ -17,3 +18,13 @@ class MyDealLapListView(ListView):
class GenerateDealCodeView(TemplateView):
template_name = "deals/deal_code.html"
+
+
+class REIDealListView(ListView):
+ model = REIDeal
+ queryset = REIDeal.objects.filter(generate_deal=True).order_by("category")
+
+ def get_context_data(self, **kwargs):
+ context = super(REIDealListView, self).get_context_data(**kwargs)
+ context['deals_count'] = REIDeal.objects.filter(generate_deal=True).count()
+ return context