Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
A
atdb-ldv
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
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
Code review analytics
Issue 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
ASTRON SDC
atdb-ldv
Commits
1c140910
Commit
1c140910
authored
3 years ago
by
Mattia Mancini
Browse files
Options
Downloads
Patches
Plain Diff
First commit
parent
663d98de
No related branches found
No related tags found
3 merge requests
!176
Master
,
!175
Master
,
!174
Add unique aggregation key endpoint
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
atdb/requirements/base.txt
+1
-1
1 addition, 1 deletion
atdb/requirements/base.txt
atdb/taskdatabase/urls.py
+3
-0
3 additions, 0 deletions
atdb/taskdatabase/urls.py
atdb/taskdatabase/views.py
+15
-0
15 additions, 0 deletions
atdb/taskdatabase/views.py
with
19 additions
and
1 deletion
atdb/requirements/base.txt
+
1
−
1
View file @
1c140910
Django==3.1.4
Django==3.1.4
djangorestframework==3.12.2
djangorestframework==3.12.2
django-filter==2.3.0
django-filter==2.3.0
psycopg2==2.
8.6
psycopg2
-binary
==2.
9.3
django-cors-headers==3.6.0
django-cors-headers==3.6.0
django-extensions==3.1.0
django-extensions==3.1.0
django-bootstrap-pagination==1.7.0
django-bootstrap-pagination==1.7.0
...
...
This diff is collapsed.
Click to expand it.
atdb/taskdatabase/urls.py
+
3
−
0
View file @
1c140910
...
@@ -61,6 +61,9 @@ urlpatterns = [
...
@@ -61,6 +61,9 @@ urlpatterns = [
path
(
'
tasks/get_size/
'
,
views
.
GetSizeView
.
as_view
(),
name
=
'
get-size-view
'
),
path
(
'
tasks/get_size/
'
,
views
.
GetSizeView
.
as_view
(),
name
=
'
get-size-view
'
),
# /atdb/get_min_start_and_max_end_time?sas_id=65005
# /atdb/get_min_start_and_max_end_time?sas_id=65005
path
(
'
get_min_start_and_max_end_time/
'
,
views
.
GetMinMaxTimeView
.
as_view
(),
name
=
'
get-min-start-and-max-end-time-view
'
),
path
(
'
get_min_start_and_max_end_time/
'
,
views
.
GetMinMaxTimeView
.
as_view
(),
name
=
'
get-min-start-and-max-end-time-view
'
),
# /atdb/get_unique_values_for_key/<aggregation_key>
path
(
'
get_unique_values_for_key/<str:aggregation_key>
'
,
views
.
GetUniqueValuesForKey
.
as_view
(),
name
=
'
get-unique-values-for-key-view
'
),
# --- controller resources ---
# --- controller resources ---
path
(
'
tasks/<int:pk>/setstatus/<new_status>/<page>
'
,
views
.
TaskSetStatus
,
name
=
'
task-setstatus-view
'
),
path
(
'
tasks/<int:pk>/setstatus/<new_status>/<page>
'
,
views
.
TaskSetStatus
,
name
=
'
task-setstatus-view
'
),
...
...
This diff is collapsed.
Click to expand it.
atdb/taskdatabase/views.py
+
15
−
0
View file @
1c140910
...
@@ -777,6 +777,21 @@ class GetMinMaxTimeView(generics.ListAPIView):
...
@@ -777,6 +777,21 @@ class GetMinMaxTimeView(generics.ListAPIView):
'
start_time
'
:
start_time
,
'
start_time
'
:
start_time
,
'
end_time
'
:
end_time
,
'
end_time
'
:
end_time
,
})
})
except
Exception
as
error
:
return
Response
({
'
error
'
:
str
(
error
)
})
# /atdb/get_unique_values_for_key/{key}
class
GetUniqueValuesForKey
(
generics
.
ListAPIView
):
queryset
=
Task
.
objects
.
all
()
# override list and generate a custom response
def
list
(
self
,
request
,
aggregation_key
,
**
kwargs
):
try
:
print
(
aggregation_key
)
return
Response
({
'
aggregation_key
'
:
aggregation_key
})
except
Exception
as
error
:
except
Exception
as
error
:
return
Response
({
return
Response
({
'
error
'
:
str
(
error
)
'
error
'
:
str
(
error
)
...
...
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