Skip to content
GitLab
Explore
Sign in
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
d5c2c7b9
Commit
d5c2c7b9
authored
3 years ago
by
Mario Raciti
Browse files
Options
Downloads
Patches
Plain Diff
TMSS-610
: Update get_cycles_report API
parent
1104b6b1
Branches
Branches containing commit
Tags
Tags containing commit
3 merge requests
!634
WIP: COBALT commissioning delta
,
!492
Resolve TMSS-610
,
!481
Draft: SW-971 SW-973 SW-975: Various fixes to build LOFAR correctly.
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
SAS/TMSS/backend/src/tmss/tmssapp/adapters/reports.py
+1
-1
1 addition, 1 deletion
SAS/TMSS/backend/src/tmss/tmssapp/adapters/reports.py
SAS/TMSS/backend/src/tmss/tmssapp/views.py
+1
-4
1 addition, 4 deletions
SAS/TMSS/backend/src/tmss/tmssapp/views.py
with
2 additions
and
5 deletions
SAS/TMSS/backend/src/tmss/tmssapp/adapters/reports.py
+
1
−
1
View file @
d5c2c7b9
...
@@ -161,7 +161,7 @@ def _get_data_ingested_per_site_and_type(request: Request, cycle: models.Cycle)
...
@@ -161,7 +161,7 @@ def _get_data_ingested_per_site_and_type(request: Request, cycle: models.Cycle)
# archive_info = models.DataproductArchiveInfo.objects.filter(dataproduct__producer__subtask__task_blueprints__draft__scheduling_unit_draft__scheduling_set__project__cycles=cycle.pk)
# archive_info = models.DataproductArchiveInfo.objects.filter(dataproduct__producer__subtask__task_blueprints__draft__scheduling_unit_draft__scheduling_set__project__cycles=cycle.pk)
# dataproducts = [ai.dataproduct for ai in archive_info]
# dataproducts = [ai.dataproduct for ai in archive_info]
# Get DataProducts related to the cycle
# Get DataProducts related to the cycle
dataproducts
=
models
.
Dataproduct
.
objects
.
filter
(
producer__subtask__task_blueprints__draft__scheduling_unit_draft__scheduling_set__project__cycles
=
cycle
.
pk
)
dataproducts
=
models
.
Dataproduct
.
objects
.
filter
(
producer__subtask__task_blueprints__draft__scheduling_unit_draft__scheduling_set__project__cycles
=
cycle
.
pk
)
# Combine and filter DataPrducts accordingly
# Combine and filter DataPrducts accordingly
...
...
This diff is collapsed.
Click to expand it.
SAS/TMSS/backend/src/tmss/tmssapp/views.py
+
1
−
4
View file @
d5c2c7b9
...
@@ -280,19 +280,16 @@ def get_target_rise_and_set(request):
...
@@ -280,19 +280,16 @@ def get_target_rise_and_set(request):
return
JsonResponse
(
rise_set_dict
)
return
JsonResponse
(
rise_set_dict
)
# TODO: Change method to POST, add other responses and change 'in_=body'.
@swagger_auto_schema
(
method
=
'
GET
'
,
responses
=
{
200
:
'
A JSON object with cycles information for reporting.
'
},
@swagger_auto_schema
(
method
=
'
GET
'
,
responses
=
{
200
:
'
A JSON object with cycles information for reporting.
'
},
manual_parameters
=
[
Parameter
(
name
=
'
cycles
'
,
required
=
True
,
type
=
'
array
'
,
in_
=
'
query
'
,
manual_parameters
=
[
Parameter
(
name
=
'
cycles
'
,
required
=
True
,
type
=
'
array
'
,
in_
=
'
query
'
,
items
=
{
'
type
'
:
'
string
'
},
description
=
"
Cycles
'
primary keys.
"
)])
items
=
{
'
type
'
:
'
string
'
},
description
=
"
Cycles
'
primary keys.
"
)])
@api_view
([
'
GET
'
])
@api_view
([
'
GET
'
])
def
get_cycles_report
(
request
):
def
get_cycles_report
(
request
):
# TODO: Sanitise inputs
cycles
=
str
(
request
.
GET
.
get
(
'
cycles
'
)).
split
(
'
,
'
)
cycles
=
str
(
request
.
GET
.
get
(
'
cycles
'
)).
split
(
'
,
'
)
results
=
{}
results
=
{}
for
c_pk
in
cycles
:
for
c_pk
in
cycles
:
c
=
get_object_or_404
(
models
.
Cycle
,
pk
=
c_pk
)
c
=
get_object_or_404
(
models
.
Cycle
,
pk
=
c_pk
)
info
=
create_cycle_report
(
request
,
c
)
results
[
c_pk
]
=
create_cycle_report
(
request
,
c
)
results
[
c_pk
]
=
info
return
JsonResponse
(
results
)
return
JsonResponse
(
results
)
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