1
Fork 0
mirror of https://github.com/pds-nest/nest.git synced 2024-12-01 17:04:19 +00:00
pds-2021-g2-nest/code/backend/nest_backend/database/tables/Contains.py
Lorenzo Balugani 390ee441c0 Fixed issues
2021-05-11 18:45:40 +02:00

14 lines
No EOL
514 B
Python

"""
This module defines the Contains database class.
"""
from ..base import ext
class Contains(ext.Model):
__tablename__ = "contains"
cid = ext.Column(ext.Integer, ext.ForeignKey("condition.id", ondelete="CASCADE"), primary_key=True)
snowflake = ext.Column(ext.String, ext.ForeignKey("tweet.snowflake", ondelete="CASCADE"), primary_key=True)
# Relationships
condition = ext.relationship("Condition", back_populates="tweets")
tweet = ext.relationship("Tweet", back_populates="conditions")