summaryrefslogtreecommitdiff
path: root/app/gtd
diff options
context:
space:
mode:
authorluxagraf <sng@luxagraf.net>2023-11-17 17:54:33 -0500
committerluxagraf <sng@luxagraf.net>2023-11-17 17:54:33 -0500
commit96866e3f83920e43e736d2ad9a89e03321dab03c (patch)
treed6ec134cf8ace1dfc37ee9dd797051478c6b32b3 /app/gtd
parentb4feff3b31daa3c29be564719796ffb29a22dbb7 (diff)
gtd: fixed note type filter
Diffstat (limited to 'app/gtd')
-rw-r--r--app/gtd/views.py20
1 files changed, 5 insertions, 15 deletions
diff --git a/app/gtd/views.py b/app/gtd/views.py
index 8a32315..c4c8d92 100644
--- a/app/gtd/views.py
+++ b/app/gtd/views.py
@@ -46,10 +46,11 @@ class GTDNoteListView(ListView):
def get_queryset(self):
if self.kwargs['note_type']:
- status_reverse = dict((v, k) for k, v in GTDNote.NOTE_TYPE)
- status = status_reverse[self.kwargs['note_type'].title()]
- return GTDNote.objects.filter(status=status)
- return GTDNote.objects.filter(status=1)
+ print(self.kwargs['note_type'])
+ note_type_reverse = dict((v, k) for k, v in GTDNote.NOTE_TYPE)
+ note_type = note_type_reverse[self.kwargs['note_type'].title()]
+ return GTDNote.objects.filter(note_type=note_type)
+ return GTDNote.objects.all()
def get_context_data(self, **kwargs):
context = super(GTDNoteListView, self).get_context_data(**kwargs)
@@ -57,17 +58,6 @@ class GTDNoteListView(ListView):
return context
-class GTDNoteWiredListView(GTDNoteListView):
-
- def get_queryset(self):
- if self.kwargs['status']:
- status_reverse = dict((v, k) for k, v in GTDNote.STATUS)
- status = status_reverse[self.kwargs['note_type'].title()]
- return GTDNote.objects.filter(status=status)
- return GTDNote.objects.filter(status=1)
-
-
-
class GTDNoteTODOView(ListView):
model = GTDNote
template_name = "gtd/note_list.html"