From 96866e3f83920e43e736d2ad9a89e03321dab03c Mon Sep 17 00:00:00 2001 From: luxagraf Date: Fri, 17 Nov 2023 17:54:33 -0500 Subject: gtd: fixed note type filter --- app/gtd/views.py | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) (limited to 'app/gtd') 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" -- cgit v1.2.3-70-g09d2