예제 #1
0
def edit(post_id):
    if request.method =='POST':
        post_manager.edit_post(post_id, request.form)
        return redirect(url_for('read' ,post_id = post_id))
    else:
        post = post_manager.get_post_by(post_id)
        return render_template('edit.html', post = post)        
예제 #2
0
def delete(post_id):
    post = post_manager.get_post_by(post_id)
    if session['user_id'] == post.user_id:
        post_manager.del_post(post_id)
    else:
        pass
        # error message, error.html / alert

    return redirect(url_for('posts', wall_id =session['wall_id']))
예제 #3
0
def read(post_id):
    post = post_manager.get_post_by(post_id)
    return render_template('read.html', post = post)