Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
LOFAR
Manage
Activity
Members
Labels
Plan
Issues
Wiki
Jira issues
Open Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Insights
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
RadioObservatory
LOFAR
Commits
d04f948c
Commit
d04f948c
authored
1 year ago
by
Reinder Kraaij
Browse files
Options
Downloads
Plain Diff
Merge branch '
TMSS-2947
' into 'master'
Resolve
TMSS-2947
Closes
TMSS-2947
See merge request
!1341
parents
97c07648
e5d95826
Branches
Branches containing commit
Tags
LOFAR-Release-4_4_150
Tags containing commit
1 merge request
!1341
Resolve TMSS-2947
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
SAS/TMSS/backend/src/tmss/workflowapp/viewsets/schedulingunitflow.py
+8
-1
8 additions, 1 deletion
...ckend/src/tmss/workflowapp/viewsets/schedulingunitflow.py
with
8 additions
and
1 deletion
SAS/TMSS/backend/src/tmss/workflowapp/viewsets/schedulingunitflow.py
+
8
−
1
View file @
d04f948c
...
@@ -15,11 +15,13 @@ from rest_framework.filters import OrderingFilter
...
@@ -15,11 +15,13 @@ from rest_framework.filters import OrderingFilter
from
drf_yasg.utils
import
swagger_auto_schema
from
drf_yasg.utils
import
swagger_auto_schema
from
django_filters
import
rest_framework
as
filters
from
django_filters
import
rest_framework
as
filters
import
django_property_filter
as
property_filters
from
viewflow.flow.views
import
FlowMixin
from
viewflow.flow.views
import
FlowMixin
from
viewflow.activation
import
STATUS_CHOICES
from
viewflow.activation
import
STATUS_CHOICES
from
lofar.sas.tmss.tmss.workflowapp
import
models
from
lofar.sas.tmss.tmss.workflowapp
import
models
from
lofar.sas.tmss.tmss.tmssapp.models
import
SchedulingUnitStatus
,
ProjectCategory
from
lofar.sas.tmss.tmss.tmssapp.adapters.keycloak
import
get_user_mapping
from
lofar.sas.tmss.tmss.tmssapp.adapters.keycloak
import
get_user_mapping
from
lofar.sas.tmss.tmss.tmssapp.viewsets.metadata
import
LOFARDefaultMetadata
from
lofar.sas.tmss.tmss.tmssapp.viewsets.metadata
import
LOFARDefaultMetadata
from
lofar.sas.tmss.tmss.tmssapp.viewsets.lofar_viewset
import
LOFARFilterBackend
,
FILTER_OVERRIDES
from
lofar.sas.tmss.tmss.tmssapp.viewsets.lofar_viewset
import
LOFARFilterBackend
,
FILTER_OVERRIDES
...
@@ -100,7 +102,7 @@ class SchedulingUnitProcessViewSet(TMSSFilterAndPermissionModelViewSet):
...
@@ -100,7 +102,7 @@ class SchedulingUnitProcessViewSet(TMSSFilterAndPermissionModelViewSet):
serializer_class
=
serializers
.
SchedulingUnitProcessSerializer
serializer_class
=
serializers
.
SchedulingUnitProcessSerializer
filter_class
=
SchedulingUnitProcessFilter
# note that this breaks other filter backends from LOFARViewSet
filter_class
=
SchedulingUnitProcessFilter
# note that this breaks other filter backends from LOFARViewSet
class
SchedulingUnitTaskFilter
(
filters
.
FilterSet
):
class
SchedulingUnitTaskFilter
(
property_filters
.
Property
FilterSet
):
id
=
NumberInFilter
(
field_name
=
'
id
'
,
lookup_expr
=
'
in
'
)
id
=
NumberInFilter
(
field_name
=
'
id
'
,
lookup_expr
=
'
in
'
)
flow_task
=
CharInFilter
(
field_name
=
'
flow_task
'
,
method
=
'
filter_flow_task
'
)
flow_task
=
CharInFilter
(
field_name
=
'
flow_task
'
,
method
=
'
filter_flow_task
'
)
flow_task_type
=
filters
.
CharFilter
(
field_name
=
'
flow_task_type
'
,
lookup_expr
=
'
icontains
'
)
flow_task_type
=
filters
.
CharFilter
(
field_name
=
'
flow_task_type
'
,
lookup_expr
=
'
icontains
'
)
...
@@ -114,6 +116,11 @@ class SchedulingUnitTaskFilter(filters.FilterSet):
...
@@ -114,6 +116,11 @@ class SchedulingUnitTaskFilter(filters.FilterSet):
owner_email_isnull
=
filters
.
BooleanFilter
(
label
=
'
owner_email [isnull]
'
,
field_name
=
'
owner__email
'
,
lookup_expr
=
'
isnull
'
)
owner_email_isnull
=
filters
.
BooleanFilter
(
label
=
'
owner_email [isnull]
'
,
field_name
=
'
owner__email
'
,
lookup_expr
=
'
isnull
'
)
owner_username
=
filters
.
CharFilter
(
field_name
=
'
owner__username
'
,
lookup_expr
=
'
icontains
'
)
owner_username
=
filters
.
CharFilter
(
field_name
=
'
owner__username
'
,
lookup_expr
=
'
icontains
'
)
owner_username_isnull
=
filters
.
BooleanFilter
(
label
=
'
owner_username [isnull]
'
,
field_name
=
'
owner__username
'
,
lookup_expr
=
'
isnull
'
)
owner_username_isnull
=
filters
.
BooleanFilter
(
label
=
'
owner_username [isnull]
'
,
field_name
=
'
owner__username
'
,
lookup_expr
=
'
isnull
'
)
project_name
=
property_filters
.
PropertyCharFilter
(
field_name
=
'
project__name
'
,
lookup_expr
=
'
icontains
'
)
project_category
=
property_filters
.
PropertyChoiceFilter
(
label
=
'
project category
'
,
field_name
=
'
project__project_category
'
,
choices
=
[(
c
.
value
,
c
.
value
)
for
c
in
ProjectCategory
.
Choices
])
scheduling_unit_status
=
filters
.
MultipleChoiceFilter
(
label
=
'
scheduling unit status [any]
'
,
field_name
=
'
process__schedulingunitprocess__su__status
'
,
choices
=
[(
c
.
value
,
c
.
value
)
for
c
in
SchedulingUnitStatus
.
Choices
],
lookup_expr
=
'
iexact
'
)
scheduling_unit_id
=
NumberInFilter
(
field_name
=
'
process__schedulingunitprocess__su__id
'
,
lookup_expr
=
'
in
'
)
scheduling_unit_name
=
filters
.
CharFilter
(
field_name
=
'
process__schedulingunitprocess__su__name
'
,
lookup_expr
=
'
icontains
'
)
def
filter_flow_task
(
self
,
queryset
,
name
,
values
):
def
filter_flow_task
(
self
,
queryset
,
name
,
values
):
ids
=
[]
ids
=
[]
...
...
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