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
b87db5b0
Commit
b87db5b0
authored
4 years ago
by
Jorrit Schaap
Browse files
Options
Downloads
Patches
Plain Diff
TMSS-573
: a dataproduct should have a unique path
parent
a59a5de0
No related branches found
No related tags found
1 merge request
!343
Resolve TMSS-557 and TMSS-307
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
SAS/TMSS/backend/src/tmss/tmssapp/models/scheduling.py
+4
-1
4 additions, 1 deletion
SAS/TMSS/backend/src/tmss/tmssapp/models/scheduling.py
with
4 additions
and
1 deletion
SAS/TMSS/backend/src/tmss/tmssapp/models/scheduling.py
+
4
−
1
View file @
b87db5b0
...
...
@@ -9,7 +9,7 @@ logger = logging.getLogger(__name__)
from
datetime
import
datetime
,
timedelta
from
django.db.models
import
Model
,
ForeignKey
,
OneToOneField
,
CharField
,
DateTimeField
,
BooleanField
,
IntegerField
,
BigIntegerField
,
\
ManyToManyField
,
CASCADE
,
SET_NULL
,
PROTECT
,
QuerySet
,
BigAutoField
ManyToManyField
,
CASCADE
,
SET_NULL
,
PROTECT
,
QuerySet
,
BigAutoField
,
UniqueConstraint
from
django.contrib.postgres.fields
import
ArrayField
,
JSONField
from
django.contrib.auth.models
import
User
from
.specification
import
AbstractChoice
,
BasicCommon
,
Template
,
NamedCommon
,
annotate_validate_add_defaults_to_doc_using_template
...
...
@@ -375,6 +375,9 @@ class Dataproduct(BasicCommon):
sap
=
ForeignKey
(
'
SAP
'
,
on_delete
=
PROTECT
,
null
=
True
,
related_name
=
"
dataproducts
"
,
help_text
=
'
SAP this dataproduct was generated out of (NULLable).
'
)
global_identifier
=
OneToOneField
(
'
SIPidentifier
'
,
editable
=
False
,
null
=
False
,
on_delete
=
PROTECT
,
help_text
=
'
The global unique identifier for LTA SIP.
'
)
class
Meta
:
constraints
=
[
UniqueConstraint
(
fields
=
[
'
directory
'
,
'
filename
'
],
name
=
'
%(class)s_unique_path
'
)]
def
save
(
self
,
force_insert
=
False
,
force_update
=
False
,
using
=
None
,
update_fields
=
None
):
annotate_validate_add_defaults_to_doc_using_template
(
self
,
'
specifications_doc
'
,
'
specifications_template
'
)
annotate_validate_add_defaults_to_doc_using_template
(
self
,
'
feedback_doc
'
,
'
feedback_template
'
)
...
...
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