18 lines
517 B
Python
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)
|