Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from flask_sqlalchemy import SQLAlchemy
- db = SQLAlchemy()
- class EscalationSchedule(db.Model):
- __tablename__ = 'escalation_schedule'
- id = db.Column(db.Integer, primary_key=True)
- name = db.Column(db.String(80), unique=True)
- api_name = db.Column(db.String(80), unique=True, index=True)
- def __init__(self, name):
- self.name = name
- self.api_name = self.generate_api_name( name )
- def generate_api_name( self, name ):
- return name
- class EscalationScheduleLevel( db.Model ):
- __tablename__ = 'escalation_schedule_level'
- id = db.Column( db.Integer, primary_key=True )
- schedule_id = db.Column( db.Integer, index=True )
- level = db.Column( db.Integer, index=True )
- breach_interval_sec = db.Column( db.Integer )
- class EscalationTarget( db.Model ):
- __tablename__ = 'escalation_target'
- id = db.Column( db.Integer, primary_key=True )
- escalation_schedule_level_id = db.Column( db.Integer, index=True )
- description = db.Column( db.String(150) )
- target = db.Column( db.String(250) )
- message = db.Column( db.Text )
- class Group( db.Model ):
- __tablename__ = 'group'
- id = db.Column(db.Integer, primary_key=True )
- name = db.Column( db.String(80) )
- zd_id = db.Column(db.Integer)
- zd_name = db.Column(db.String(80) )
- escalation_schedule_id = db.Column( db.Integer )
Advertisement
Add Comment
Please, Sign In to add comment