Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
L
LDV Specification
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Jira
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
LDV Specification
Merge requests
!7
Add script csv gen
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Add script csv gen
add_script_csv_gen
into
main
Overview
7
Commits
22
Pipelines
4
Changes
2
3 unresolved threads
Hide all comments
Merged
Mattia Mancini
requested to merge
add_script_csv_gen
into
main
2 years ago
Overview
7
Commits
22
Pipelines
4
Changes
2
3 unresolved threads
Hide all comments
Expand
0
0
Merge request reports
Viewing commit
f564432a
Prev
Next
Show latest version
2 files
+
2
−
1
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
2
Search (e.g. *.vue) (Ctrl+P)
f564432a
Add work-specification
· f564432a
Mattia Mancini
authored
2 years ago
ldvspec/lofardata/models.py
+
32
−
1
Options
from
django.db
import
models
from
django_filters
import
rest_framework
as
filters
from
urllib.parse
import
urlsplit
from
django.contrib.auth.models
import
User
from
django.contrib.postgres.fields
import
ArrayField
from
celery.result
import
AsyncResult
class
DataLocation
(
models
.
Model
):
@@ -74,3 +76,32 @@ class DataProductFilter(models.Model):
field
=
models
.
CharField
(
max_length
=
100
)
name
=
models
.
CharField
(
max_length
=
20
)
lookup_type
=
models
.
CharField
(
max_length
=
100
)
class
ATDBProcessingSite
(
models
.
Model
):
name
=
models
.
CharField
(
primary_key
=
True
,
max_length
=
100
)
url
=
models
.
URLField
()
access_token
=
models
.
CharField
(
max_length
=
1000
,
null
=
True
)
class
WorkSpecification
(
models
.
Model
):
created_on
=
models
.
DateTimeField
(
auto_now_add
=
True
)
created_by
=
models
.
ForeignKey
(
User
,
on_delete
=
models
.
DO_NOTHING
,
null
=
True
)
filters
=
models
.
JSONField
(
null
=
True
)
inputs
=
models
.
JSONField
(
null
=
True
)
selected_workflow
=
models
.
CharField
(
max_length
=
500
,
null
=
True
)
related_tasks
=
ArrayField
(
models
.
IntegerField
(),
null
=
True
)
is_ready
=
models
.
BooleanField
(
default
=
False
)
is_defined
=
models
.
BooleanField
(
default
=
False
)
async_task_result
=
models
.
CharField
(
max_length
=
100
,
null
=
True
)
processing_site
=
models
.
ForeignKey
(
ATDBProcessingSite
,
null
=
True
,
on_delete
=
models
.
DO_NOTHING
)
def
save
(
self
,
force_insert
=
False
,
force_update
=
False
,
using
=
None
,
update_fields
=
None
):
super
(
WorkSpecification
,
self
).
save
(
force_insert
=
force_insert
,
force_update
=
force_update
,
using
=
using
,
update_fields
=
update_fields
)
if
self
.
async_task_result
is
None
:
from
lofardata.tasks
import
define_work_specification
res
:
AsyncResult
=
define_work_specification
.
delay
(
self
.
pk
)
self
.
async_task_result
=
res
.
id
super
(
WorkSpecification
,
self
).
save
(
update_fields
=
[
'
async_task_result
'
])
Loading