summaryrefslogtreecommitdiff
path: root/app/gtd/views.py
diff options
context:
space:
mode:
Diffstat (limited to 'app/gtd/views.py')
-rw-r--r--app/gtd/views.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/app/gtd/views.py b/app/gtd/views.py
index dbf7587..9643511 100644
--- a/app/gtd/views.py
+++ b/app/gtd/views.py
@@ -60,9 +60,7 @@ class GTDNoteListView(ListView):
def get_queryset(self):
project = self.request.GET.get("project", False)
if self.kwargs['note_type']:
- 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()]
+ note_type = NoteType.string_to_int(self.kwargs['note_type'].title())
if project:
return GTDNote.objects.filter(note_type=note_type, project__title=project, status__in=[0,1])
return GTDNote.objects.filter(note_type=note_type, status__in=[0,1])
@@ -73,7 +71,7 @@ class GTDNoteListView(ListView):
def get_context_data(self, **kwargs):
context = super(GTDNoteListView, self).get_context_data(**kwargs)
- context['note_types'] = GTDNote.NOTE_TYPE
+ context['note_types'] = NoteType
context['projects'] = GTDProject.objects.all()
context['project'] = self.request.GET.get("project", False)
return context