def new_post(self, title, content, date=datetime.datetime.utcnow()): post = Post(blog_id=self._id, title=title, content=content, author=self.author, date=date) post.save_post()
def save_post(author, content, title, categorie): """ Save a post and return the id of the saved post """ post = Post.save_post(author, content, title, categorie) return post.id