1
Fork 0
mirror of https://github.com/pds-nest/nest.git synced 2024-11-30 00:14:19 +00:00
pds-2021-g2-nest/code/backend/nest_backend/database/tables/Contains.py

14 lines
474 B
Python
Raw Normal View History

"""
This module defines the Contains database class.
"""
2021-05-07 17:46:14 +00:00
from ..base import ext
2021-05-07 17:46:14 +00:00
class Contains(ext.Model):
__tablename__ = "contains"
2021-05-07 17:46:14 +00:00
cid = ext.Column(ext.Integer, ext.ForeignKey("condition.id"), primary_key=True)
snowflake = ext.Column(ext.String, ext.ForeignKey("tweet.snowflake"), primary_key=True)
# Relationships
2021-05-07 17:46:14 +00:00
condition = ext.relationship("Condition", back_populates="tweets")
tweet = ext.relationship("Tweet", back_populates="conditions")