def change_rank(pk, change): post = Post.update(rank=Post.rank + change).where(Post.pk == pk) return post.execute()
def edit_post(pk, title, content, points): post = Post.update(title=title, content=content, points=points).where(Post.pk == pk) return post.execute()
def delete_post(pk): post = Post.update(hidden=1).where(Post.pk == pk) _ = delete_post_votes(pk) return post.execute()