Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
hypha
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ots
hypha
Commits
eb5880d7
Commit
eb5880d7
authored
5 years ago
by
Fredrik Jonsson
Browse files
Options
Downloads
Patches
Plain Diff
Add meta term filter to submission tables.
parent
d83dcc32
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
hypha/apply/funds/tables.py
+7
-0
7 additions, 0 deletions
hypha/apply/funds/tables.py
with
7 additions
and
0 deletions
hypha/apply/funds/tables.py
+
7
−
0
View file @
eb5880d7
...
@@ -13,6 +13,7 @@ from django.utils.translation import ugettext_lazy as _
...
@@ -13,6 +13,7 @@ from django.utils.translation import ugettext_lazy as _
from
django_tables2.utils
import
A
from
django_tables2.utils
import
A
from
wagtail.core.models
import
Page
from
wagtail.core.models
import
Page
from
hypha.apply.categories.models
import
MetaTerm
from
hypha.apply.funds.models
import
ApplicationSubmission
,
Round
,
ScreeningStatus
from
hypha.apply.funds.models
import
ApplicationSubmission
,
Round
,
ScreeningStatus
from
hypha.apply.funds.workflow
import
STATUSES
,
get_review_active_statuses
from
hypha.apply.funds.workflow
import
STATUSES
,
get_review_active_statuses
from
hypha.apply.users.groups
import
STAFF_GROUP_NAME
from
hypha.apply.users.groups
import
STAFF_GROUP_NAME
...
@@ -186,6 +187,11 @@ def get_screening_statuses(request):
...
@@ -186,6 +187,11 @@ def get_screening_statuses(request):
id__in
=
ApplicationSubmission
.
objects
.
all
().
values
(
'
screening_status__id
'
).
distinct
(
'
screening_status__id
'
))
id__in
=
ApplicationSubmission
.
objects
.
all
().
values
(
'
screening_status__id
'
).
distinct
(
'
screening_status__id
'
))
def
get_meta_terms
(
request
):
return
MetaTerm
.
objects
.
filter
(
id__in
=
ApplicationSubmission
.
objects
.
all
().
values
(
'
meta_terms__id
'
).
distinct
(
'
meta_terms__id
'
))
class
Select2CheckboxWidgetMixin
(
filters
.
Filter
):
class
Select2CheckboxWidgetMixin
(
filters
.
Filter
):
def
__init__
(
self
,
*
args
,
**
kwargs
):
def
__init__
(
self
,
*
args
,
**
kwargs
):
label
=
kwargs
.
get
(
'
label
'
)
label
=
kwargs
.
get
(
'
label
'
)
...
@@ -233,6 +239,7 @@ class SubmissionFilter(filters.FilterSet):
...
@@ -233,6 +239,7 @@ class SubmissionFilter(filters.FilterSet):
lead
=
Select2ModelMultipleChoiceFilter
(
queryset
=
get_round_leads
,
label
=
'
Leads
'
)
lead
=
Select2ModelMultipleChoiceFilter
(
queryset
=
get_round_leads
,
label
=
'
Leads
'
)
reviewers
=
Select2ModelMultipleChoiceFilter
(
queryset
=
get_reviewers
,
label
=
'
Reviewers
'
)
reviewers
=
Select2ModelMultipleChoiceFilter
(
queryset
=
get_reviewers
,
label
=
'
Reviewers
'
)
screening_status
=
Select2ModelMultipleChoiceFilter
(
queryset
=
get_screening_statuses
,
label
=
'
Screening
'
)
screening_status
=
Select2ModelMultipleChoiceFilter
(
queryset
=
get_screening_statuses
,
label
=
'
Screening
'
)
meta_terms
=
Select2ModelMultipleChoiceFilter
(
queryset
=
get_meta_terms
,
label
=
'
Terms
'
)
class
Meta
:
class
Meta
:
model
=
ApplicationSubmission
model
=
ApplicationSubmission
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment