Пример #1
0
def change_rank(pk, change):
    post = Post.update(rank=Post.rank + change).where(Post.pk == pk)
    return post.execute()
Пример #2
0
def edit_post(pk, title, content, points):
    post = Post.update(title=title, content=content, points=points).where(Post.pk == pk)
    return post.execute()
Пример #3
0
def delete_post(pk):
    post = Post.update(hidden=1).where(Post.pk == pk)
    _ = delete_post_votes(pk)
    return post.execute()