crunk-scheduler/models/postmodel.py

17 lines
492 B
Python

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)
last_updated = db.Column(db.DateTime(timezone=True))
scheduled_time = db.Column(db.DateTime(timezone=True))
def __repr__(self):
return "<Post %r>" % self.id