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
6f6debad
Commit
6f6debad
authored
5 years ago
by
Parbhat Puri
Committed by
Fredrik Jonsson
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
filter by fund - Filters submissions by specified fund and lab, allows multiple
parent
ac4f563c
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
opentech/apply/funds/api_views.py
+9
-1
9 additions, 1 deletion
opentech/apply/funds/api_views.py
with
9 additions
and
1 deletion
opentech/apply/funds/api_views.py
+
9
−
1
View file @
6f6debad
...
...
@@ -2,6 +2,9 @@ from django.core.exceptions import PermissionDenied as DjangoPermissionDenied
from
django.db
import
transaction
from
django.db.models
import
Q
,
Prefetch
from
django.utils
import
timezone
from
wagtail.core.models
import
Page
from
rest_framework
import
generics
,
mixins
,
permissions
from
rest_framework.response
import
Response
from
rest_framework.exceptions
import
(
NotFound
,
PermissionDenied
,
...
...
@@ -13,6 +16,7 @@ from opentech.apply.activity.models import Activity, COMMENT
from
opentech.apply.activity.messaging
import
messenger
,
MESSAGES
from
opentech.apply.determinations.views
import
DeterminationCreateOrUpdateView
from
opentech.apply.review.models
import
Review
from
opentech.apply.funds.models
import
FundType
,
LabType
from
.models
import
ApplicationSubmission
,
RoundsAndLabs
from
.serializers
import
(
...
...
@@ -42,10 +46,14 @@ class SubmissionsFilter(filters.FilterSet):
status
=
filters
.
MultipleChoiceFilter
(
choices
=
PHASES
)
active
=
filters
.
BooleanFilter
(
method
=
'
filter_active
'
,
label
=
'
Active
'
)
submit_date
=
filters
.
DateFromToRangeFilter
(
name
=
'
submit_time
'
,
label
=
'
Submit date
'
)
fund
=
filters
.
ModelMultipleChoiceFilter
(
name
=
'
page
'
,
label
=
'
fund
'
,
queryset
=
Page
.
objects
.
type
(
FundType
)
|
Page
.
objects
.
type
(
LabType
)
)
class
Meta
:
model
=
ApplicationSubmission
fields
=
(
'
status
'
,
'
round
'
,
'
active
'
,
'
submit_date
'
,
)
fields
=
(
'
status
'
,
'
round
'
,
'
active
'
,
'
submit_date
'
,
'
fund
'
,
)
def
filter_active
(
self
,
qs
,
name
,
value
):
if
value
is
None
:
...
...
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