blog/webapp/models/_blog_post.py
Daniel Tsvetkov e56ef23c2d morse added
2021-02-25 11:44:30 +01:00

18 lines
517 B
Python

from oshipka.persistance import db, ModelController, index_service, LiberalBoolean, Ownable
class BlogPost(db.Model, ModelController, Ownable):
__searchable__ = ['body', ]
filename = db.Column(db.UnicodeText,)
title = db.Column(db.UnicodeText,)
body = db.Column(db.UnicodeText,)
created_dt = db.Column(db.UnicodeText,)
updated_dt = db.Column(db.UnicodeText,)
def __repr__(self):
return "{} ({})".format(self.title, self.created_dt)
index_service.searchables.append(BlogPost)