diff --git a/opentech/apply/dashboard/tables.py b/opentech/apply/dashboard/tables.py index 74ad34a900dfdca50359cdec436a369c670bec54..d51aa4b49db3d135a851fb1d47b287a5cccc8a2c 100644 --- a/opentech/apply/dashboard/tables.py +++ b/opentech/apply/dashboard/tables.py @@ -1,6 +1,8 @@ import django_filters as filters import django_tables2 as tables +from wagtail.wagtailcore.models import Page + from opentech.apply.funds.models import ApplicationSubmission, Round @@ -23,9 +25,15 @@ def get_used_rounds(request): return Round.objects.filter(submissions__isnull=False).distinct() +def get_used_funds(request): + # Use page to pick up on both Labs and Funds + return Page.objects.filter(applicationsubmission__isnull=False).distinct() + + class SubmissionFilter(filters.FilterSet): round = filters.ModelMultipleChoiceFilter(queryset=get_used_rounds) + page = filters.ModelMultipleChoiceFilter(queryset=get_used_funds, label='Funds') class Meta: model = ApplicationSubmission - fields = ('round',) + fields = ('page', 'round',)