Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
nopaque
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Monitor
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SFB 1288 - INF
nopaque
Commits
07c10419
Commit
07c10419
authored
4 years ago
by
Stephan Porada
Browse files
Options
Downloads
Patches
Plain Diff
Add Notification model
parent
cb8f3faa
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
app/models.py
+22
-0
22 additions, 0 deletions
app/models.py
migrations/versions/471aa04c1a92_.py
+38
-0
38 additions, 0 deletions
migrations/versions/471aa04c1a92_.py
with
60 additions
and
0 deletions
app/models.py
+
22
−
0
View file @
07c10419
...
...
@@ -341,6 +341,10 @@ class Job(db.Model):
cascade
=
'
save-update, merge, delete
'
)
results
=
db
.
relationship
(
'
JobResult
'
,
backref
=
'
job
'
,
lazy
=
'
dynamic
'
,
cascade
=
'
save-update, merge, delete
'
)
notifications_data
=
db
.
relationship
(
'
NotificationData
'
,
backref
=
'
job
'
,
lazy
=
'
dynamic
'
,
cascade
=
'
save-update, merge, delete
'
)
def
__repr__
(
self
):
"""
...
...
@@ -384,6 +388,24 @@ class Job(db.Model):
'
title
'
:
self
.
title
}
class
NotificationData
(
db
.
Model
):
"""
Class to define notification data used for sending a notification mail with
nopaque_notify.
"""
__tablename__
=
'
notifications_data
'
# Primary key
id
=
db
.
Column
(
db
.
Integer
,
primary_key
=
True
)
# Foreign Key
job_id
=
db
.
Column
(
db
.
Integer
,
db
.
ForeignKey
(
'
jobs.id
'
))
# Fields
notified_on_submitted
=
db
.
Column
(
db
.
Boolean
,
default
=
False
)
notified_on_queued
=
db
.
Column
(
db
.
Boolean
,
default
=
False
)
notified_on_running
=
db
.
Column
(
db
.
Boolean
,
default
=
False
)
notified_on_complete
=
db
.
Column
(
db
.
Boolean
,
default
=
False
)
notified_on_canceling
=
db
.
Column
(
db
.
Boolean
,
default
=
False
)
class
CorpusFile
(
db
.
Model
):
"""
Class to define Files.
...
...
This diff is collapsed.
Click to expand it.
migrations/versions/471aa04c1a92_.py
0 → 100644
+
38
−
0
View file @
07c10419
"""
empty message
Revision ID: 471aa04c1a92
Revises: 62233e0cb2c7
Create Date: 2020-05-11 14:07:12.934869
"""
from
alembic
import
op
import
sqlalchemy
as
sa
# revision identifiers, used by Alembic.
revision
=
'
471aa04c1a92
'
down_revision
=
'
62233e0cb2c7
'
branch_labels
=
None
depends_on
=
None
def
upgrade
():
# ### commands auto generated by Alembic - please adjust! ###
op
.
create_table
(
'
notifications_data
'
,
sa
.
Column
(
'
id
'
,
sa
.
Integer
(),
nullable
=
False
),
sa
.
Column
(
'
job_id
'
,
sa
.
Integer
(),
nullable
=
True
),
sa
.
Column
(
'
notified_on_submitted
'
,
sa
.
Boolean
(),
nullable
=
True
),
sa
.
Column
(
'
notified_on_queued
'
,
sa
.
Boolean
(),
nullable
=
True
),
sa
.
Column
(
'
notified_on_running
'
,
sa
.
Boolean
(),
nullable
=
True
),
sa
.
Column
(
'
notified_on_complete
'
,
sa
.
Boolean
(),
nullable
=
True
),
sa
.
Column
(
'
notified_on_canceling
'
,
sa
.
Boolean
(),
nullable
=
True
),
sa
.
ForeignKeyConstraint
([
'
job_id
'
],
[
'
jobs.id
'
],
),
sa
.
PrimaryKeyConstraint
(
'
id
'
)
)
# ### end Alembic commands ###
def
downgrade
():
# ### commands auto generated by Alembic - please adjust! ###
op
.
drop_table
(
'
notifications_data
'
)
# ### end Alembic commands ###
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