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

17 lines
640 B
Python
Raw Normal View History

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