From 2e099ad635403a0ee86c358eb5ab490656731197 Mon Sep 17 00:00:00 2001 From: Jan Tuomi Date: Thu, 19 Oct 2017 20:01:13 +0300 Subject: [PATCH] Add custom kaehmys to filter list --- webapp/views.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/webapp/views.py b/webapp/views.py index 3638425..dc1752b 100644 --- a/webapp/views.py +++ b/webapp/views.py @@ -235,7 +235,11 @@ def kaehmy_list_view(request, *args, **kwargs): applications = applications.order_by('-timestamp') filter_options_preset = PresetKaehmyRole.objects.annotate(form_count=Count('forms')).filter(form_count__gt=0) - filter_options = [(r.id, r.name, r.form_count) for r in filter_options_preset] + filter_options_preset_list = [(r.id, r.name, r.form_count) for r in filter_options_preset] + filter_options_custom = CustomKaehmyRole.objects.annotate(form_count=Count('forms')).filter(form_count__gt=0) + filter_options_custom_list = [(r.id, r.name, r.form_count) for r in filter_options_custom] + + filter_options = filter_options_preset_list + filter_options_custom_list context = { 'applications': applications,