diff options
author | luxagraf <sng@luxagraf.net> | 2023-11-17 16:51:54 -0500 |
---|---|---|
committer | luxagraf <sng@luxagraf.net> | 2023-11-17 16:51:54 -0500 |
commit | cb738fd973664b1458a6aa343be06cee57eb4c5e (patch) | |
tree | 763d022e0fe79ef7d4f2cd096e45a560ceb8d312 /app/gtd/views.py | |
parent | 6b1ae214361f533e53d8993a530e5d2b17c4f4e9 (diff) |
gtd: decided against integrating wired
Diffstat (limited to 'app/gtd/views.py')
-rw-r--r-- | app/gtd/views.py | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/app/gtd/views.py b/app/gtd/views.py index 2a95925..8a32315 100644 --- a/app/gtd/views.py +++ b/app/gtd/views.py @@ -45,18 +45,29 @@ class GTDNoteListView(ListView): template_name = "gtd/note_list.html" def get_queryset(self): - if self.kwargs['status']: - status_reverse = dict((v, k) for k, v in GTDNote.STATUS) - status = status_reverse[self.kwargs['status'].title()] + 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) def get_context_data(self, **kwargs): context = super(GTDNoteListView, self).get_context_data(**kwargs) - context['note_statuses'] = GTDNote.STATUS + context['note_types'] = GTDNote.NOTE_TYPE 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" |