1
Fork 0
mirror of https://github.com/pds-nest/nest.git synced 2024-11-24 05:54:18 +00:00
pds-2021-g2-nest/nest_backend/database/tables/MadeOf.py
2021-05-17 15:29:08 +02:00

14 lines
No EOL
477 B
Python

"""
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")