Switch to side-by-side view
--- a/ForgeBlog/forgeblog/model/blog.py +++ b/ForgeBlog/forgeblog/model/blog.py @@ -62,6 +62,9 @@ timestamp = FieldProperty(datetime, if_missing=datetime.utcnow) slug = FieldProperty(str) state = FieldProperty(schema.OneOf('draft', 'published'), if_missing='draft') + + def author(self): + return M.User.query.get(_id=self.history().first().author.id) or User.anonymous def _get_date(self): return self.timestamp.date()