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
7fc41630
Commit
7fc41630
authored
5 years ago
by
Jorrit Schaap
Browse files
Options
Downloads
Patches
Plain Diff
TMSS-153
: added REST url to get the parset for a subtask instance
parent
77206e56
No related branches found
No related tags found
1 merge request
!102
Resolve TMSS-153
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
SAS/TMSS/src/tmss/tmssapp/views.py
+7
-1
7 additions, 1 deletion
SAS/TMSS/src/tmss/tmssapp/views.py
SAS/TMSS/src/tmss/urls.py
+2
-0
2 additions, 0 deletions
SAS/TMSS/src/tmss/urls.py
with
9 additions
and
1 deletion
SAS/TMSS/src/tmss/tmssapp/views.py
+
7
−
1
View file @
7fc41630
from
django.http
import
HttpResponse
,
JsonResponse
from
django.shortcuts
import
get_object_or_404
from
lofar.sas.tmss.tmss.tmssapp.models.scheduling
import
SubtaskTemplate
from
lofar.sas.tmss.tmss.tmssapp.models.scheduling
import
SubtaskTemplate
,
Subtask
from
lofar.common.json_utils
import
get_default_json_object_for_schema
from
lofar.sas.tmss.tmss.tmssapp.adapters.parset
import
convert_to_parset
def
subtask_template_default_specification
(
request
,
subtask_template_pk
:
int
):
subtask_template
=
get_object_or_404
(
SubtaskTemplate
,
pk
=
subtask_template_pk
)
spec
=
get_default_json_object_for_schema
(
subtask_template
.
schema
)
return
JsonResponse
(
spec
)
def
subtask_parset
(
request
,
subtask_pk
:
int
):
subtask
=
get_object_or_404
(
Subtask
,
pk
=
subtask_pk
)
parset
=
convert_to_parset
(
subtask
)
return
HttpResponse
(
str
(
parset
),
content_type
=
'
text/plain
'
)
This diff is collapsed.
Click to expand it.
SAS/TMSS/src/tmss/urls.py
+
2
−
0
View file @
7fc41630
...
...
@@ -121,7 +121,9 @@ router.register(r'default_subtask_template', viewsets.DefaultSubtaskTemplateView
router
.
register
(
r
'
default_dataproduct_specifications_template
'
,
viewsets
.
DefaultDataproductSpecificationsTemplateViewSet
)
router
.
register
(
r
'
subtask_input_selection_template
'
,
viewsets
.
SubtaskInputSelectionTemplateViewSet
)
router
.
register
(
r
'
dataproduct_feedback_template
'
,
viewsets
.
DataproductFeedbackTemplateViewSet
)
urlpatterns
.
append
(
re_path
(
r
'
subtask_template/(?P<subtask_template_pk>\d+)/default_specification
'
,
views
.
subtask_template_default_specification
))
urlpatterns
.
append
(
re_path
(
r
'
subtask/(?P<subtask_pk>\d+)/parset
'
,
views
.
subtask_parset
))
# instances
#router.register(r'subtask', viewsets.SubtaskViewSet) # todo: default view, re-activate or remove the JSON editor one in bottom
...
...
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