def render_post(uri, post_id):
    post = Post.get_by_id(post_id)
    if request.method == 'GET':
        return render_template("admin_posts.html",
                               post=post,
                               acc=session['email'])
    else:
        title = request.form['title']
        content = request.form['content']
        post = Post.get_by_id(post_id)
        post.update("title", title)
        post.update("content", content)
        post = Post.get_by_id(post_id)
        return render_template("admin_posts.html",
                               post=post,
                               acc=session['email'])
def get_images(post_id):
    post = Post.get_by_id(post_id)
    if post.imgs is not None:
        return dumps(post.imgs)
    else:
        return dumps({'imgs': {}})
def render_posts(post_id):
    post = Post.get_by_id(post_id)
    return render_template("post.html", post=post, acc=session['email'])