标签:hidden app com 实现 route add comment hid orm
@app.route(‘/comment/‘,methods=[‘POST‘]) @loginFirst def comment(): comment = request.form.get(‘new_comment‘) ques_id = request.form.get(‘question_id‘) auth_id = User.query.filter(User.username == session.get(‘user‘)).first().id comm = Comment(author_id=auth_id, question_id=ques_id, detail=comment) db.session.add(comm) db.session.commit() return redirect(url_for(‘detail‘ , question_id = ques_id))
标签:hidden app com 实现 route add comment hid orm
原文地址:http://www.cnblogs.com/xiepingjian/p/8004685.html