class ObjectUseAirlineModel(db.Model): __tablename__ = 'object_use_airline' id = db.Column(db.Integer, primary_key=True) object_id = db.Column(db.String(50), nullable=False) flight_task_number = db.Column(db.String(50), nullable=False) pub_date = db.Column(db.DateTime, nullable=False, default=datetime.utcnow) airline_id = db.Column(db.Integer, db.ForeignKey('airline.id'), nullable=False)
class ExceptionTypeModel(db.Model): __tablename__ = 'exceptiontype' lastappeared_id = db.Column(db.Integer, db.ForeignKey('lastappeared.id', ondelete="CASCADE"), primary_key=True) exceptiontype = db.Column(db.String()) def dictRepr(self): return { "lastappeared_id": self.lastappeared_id, "exceptiontype": self.exceptiontype }
def lastappeared_id(cls): return db.Column(db.Integer, db.ForeignKey('lastappeared.id', ondelete="CASCADE"), primary_key=True)