mirror of
https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
synced 2025-06-12 09:00:40 +00:00
Add Notification model
This commit is contained in:
@ -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.
|
||||
|
Reference in New Issue
Block a user