crunk-scheduler/models/postmodel.py

17 lines
492 B
Python
Raw Normal View History

2023-07-19 22:30:33 +02:00
from app import db
class Post(db.Model):
"""post model class for storing a post in crunk-scheduler database"""
__tablename__ = "posts"
id = db.Column(db.Integer, primary_key=True)
content = db.Column(db.String, nullable=False)
files = db.Column(db.String(300), nullable=True, unique=False)
2023-10-08 23:44:00 +02:00
last_updated = db.Column(db.DateTime(timezone=True))
scheduled_time = db.Column(db.DateTime(timezone=True))
2023-07-19 22:30:33 +02:00
def __repr__(self):
return "<Post %r>" % self.id