def add_comment(key, author, content): comment = Content(title=content["title"], content=content["content"], author=author) update = Content.get(key, bucket="spm_posts") update.comments.append(comment) comment.save(bucket="spm_comments") update.save(bucket="spm_posts") return comment
def post_update(author, content): update = Content(title=content["title"], content=content["content"], author=author) update.save(bucket="spm_posts") return update
def add_wall_post(key, content, user): post = Content(title=content, author=user) post.addIndex("project_bin", key) post.save(bucket="spm_wallposts") return post