Filters
hypha.apply.api.v1.filters
¶
SubmissionsFilter
¶
Bases: FilterSet
Source code in hypha/apply/api/v1/filters.py
round
class-attribute
instance-attribute
¶
round = ModelMultipleChoiceFilter(field_name='round', queryset=get_used_rounds())
active
class-attribute
instance-attribute
¶
submit_date
class-attribute
instance-attribute
¶
fund
class-attribute
instance-attribute
¶
screening_statuses
class-attribute
instance-attribute
¶
screening_statuses = ModelMultipleChoiceFilter(field_name='screening_statuses', queryset=get_screening_statuses(), null_label=gettext_lazy('No Screening'))
reviewers
class-attribute
instance-attribute
¶
reviewers = ModelMultipleChoiceFilter(field_name='reviewers', queryset=get_all_reviewers())
lead
class-attribute
instance-attribute
¶
lead = ModelMultipleChoiceFilter(field_name='lead', queryset=get_round_leads())
category_options
class-attribute
instance-attribute
¶
category_options = MultipleChoiceFilter(choices=[], label=gettext_lazy('Category'), method='filter_category_options')
id
class-attribute
instance-attribute
¶
Meta
¶
fields
class-attribute
instance-attribute
¶
fields = ('id', 'status', 'round', 'active', 'submit_date', 'fund', 'screening_statuses', 'reviewers', 'lead')
filter_active
¶
filter_category_options
¶
Filter submissions based on the category options selected.
In order to do that we need to first get all the category fields used in the submission.
And then use those category fields to filter submissions with their form_data.