2021-04-21 16:47:18 +00:00
|
|
|
"""
|
|
|
|
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
|
2021-05-01 12:25:50 +00:00
|
|
|
repositories = Base.relationship("Composed", back_populates="tweet", cascade="all, delete")
|
|
|
|
conditions = Base.relationship("Contains", back_populates="tweet", cascade="all, delete")
|