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
Commits
9622dab9
Commit
9622dab9
authored
2 years ago
by
Fanna Lautenbach
Browse files
Options
Downloads
Patches
Plain Diff
add group to model
parent
9988cf17
No related branches found
No related tags found
2 merge requests
!70
Add form, url, template and view; no functionality yet
,
!69
Group to model
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
ldvspec/lofardata/migrations/0017_group_workspecification_group.py
+30
-0
30 additions, 0 deletions
...ofardata/migrations/0017_group_workspecification_group.py
ldvspec/lofardata/models.py
+15
-0
15 additions, 0 deletions
ldvspec/lofardata/models.py
with
45 additions
and
0 deletions
ldvspec/lofardata/migrations/0017_group_workspecification_group.py
0 → 100644
+
30
−
0
View file @
9622dab9
# Generated by Django 4.1.5 on 2023-01-19 09:17
from
django.db
import
migrations
,
models
import
django.db.models.deletion
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'
lofardata
'
,
'
0016_alter_workspecification_inputs_and_more
'
),
]
operations
=
[
migrations
.
CreateModel
(
name
=
'
Group
'
,
fields
=
[
(
'
id
'
,
models
.
BigAutoField
(
auto_created
=
True
,
primary_key
=
True
,
serialize
=
False
,
verbose_name
=
'
ID
'
)),
(
'
name
'
,
models
.
CharField
(
max_length
=
50
,
unique
=
True
)),
(
'
selected_workflow
'
,
models
.
CharField
(
blank
=
True
,
default
=
''
,
max_length
=
500
)),
(
'
selected_workflow_tag
'
,
models
.
CharField
(
blank
=
True
,
default
=
''
,
max_length
=
500
)),
(
'
processing_site
'
,
models
.
ForeignKey
(
blank
=
True
,
null
=
True
,
on_delete
=
django
.
db
.
models
.
deletion
.
SET_NULL
,
to
=
'
lofardata.atdbprocessingsite
'
)),
(
'
work_specifications
'
,
models
.
ManyToManyField
(
blank
=
True
,
related_name
=
'
+
'
,
to
=
'
lofardata.workspecification
'
)),
],
),
migrations
.
AddField
(
model_name
=
'
workspecification
'
,
name
=
'
group
'
,
field
=
models
.
ForeignKey
(
default
=
None
,
null
=
True
,
on_delete
=
django
.
db
.
models
.
deletion
.
SET_DEFAULT
,
to
=
'
lofardata.group
'
),
),
]
This diff is collapsed.
Click to expand it.
ldvspec/lofardata/models.py
+
15
−
0
View file @
9622dab9
...
...
@@ -4,6 +4,7 @@ from django.contrib.auth.models import User
from
django.contrib.postgres.fields
import
ArrayField
from
django.db
import
models
,
IntegrityError
from
django.utils.translation
import
gettext_lazy
as
_
logger
=
logging
.
getLogger
(
__name__
)
...
...
@@ -109,11 +110,25 @@ class PURGE_POLICY(models.TextChoices):
DO
=
"
do
"
,
_
(
"
do
"
)
# only purge, no workflow execution
class
Group
(
models
.
Model
):
"""
Group to which work specification belongs
"""
name
=
models
.
CharField
(
max_length
=
50
,
unique
=
True
)
work_specifications
=
models
.
ManyToManyField
(
'
WorkSpecification
'
,
blank
=
True
,
related_name
=
'
+
'
)
# ATDB info
processing_site
=
models
.
ForeignKey
(
ATDBProcessingSite
,
null
=
True
,
blank
=
True
,
on_delete
=
models
.
SET_NULL
)
selected_workflow
=
models
.
CharField
(
max_length
=
500
,
blank
=
True
,
default
=
''
)
selected_workflow_tag
=
models
.
CharField
(
max_length
=
500
,
blank
=
True
,
default
=
''
)
class
WorkSpecification
(
models
.
Model
):
"""
Work Specification
"""
created_on
=
models
.
DateTimeField
(
auto_now_add
=
True
)
created_by
=
models
.
ForeignKey
(
User
,
on_delete
=
models
.
DO_NOTHING
,
null
=
True
)
group
=
models
.
ForeignKey
(
Group
,
null
=
True
,
default
=
None
,
on_delete
=
models
.
SET_DEFAULT
)
filters
=
models
.
JSONField
(
null
=
True
)
# Input data containing sizes/urls for submission to ATDB
inputs
=
models
.
JSONField
(
null
=
True
,
blank
=
True
)
...
...
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