1
Fork 0
mirror of https://github.com/pds-nest/nest.git synced 2024-11-28 23:44:19 +00:00
pds-2021-g2-nest/nest_backend/database/tables/MadeOf.py

14 lines
477 B
Python
Raw Normal View History

2021-05-17 13:29:08 +00:00
"""
This module defines the MadeOf database class.
"""
from ..base import ext
class MadeOf(ext.Model):
__tablename__ = "made_of"
aid = ext.Column(ext.Integer, ext.ForeignKey("alert.id", ondelete="CASCADE"), primary_key=True)
cid = ext.Column(ext.Integer, ext.ForeignKey("condition.id"), primary_key=True)
# Relationships
alert = ext.relationship("Alert", back_populates="conditions")
condition = ext.relationship("Condition", back_populates="alerts")