1
Fork 0
mirror of https://github.com/pds-nest/nest.git synced 2024-11-27 07:24:17 +00:00
pds-2021-g2-nest/code/backend/nest_backend/database/tables/Tweet.py

16 lines
651 B
Python
Raw Normal View History

"""
This module defines the Tweet database class.
"""
from ..base import Base
class Tweet(Base.Model):
__tablename__ = "tweet"
snowflake = Base.Column(Base.String, primary_key=True)
content = Base.Column(Base.String)
location = Base.Column(Base.String) # Todo: see if a dedicated class for locations is needed. This is likely.
poster = Base.Column(Base.String) # Todo: see if a dedicated class for posters is needed.
# Relationships
repositories = Base.relationship("Composed", back_populates="tweet", cascade="all, delete")
conditions = Base.relationship("Contains", back_populates="tweet", cascade="all, delete")