标签:列表 nts type 定义 input 获取 color session hid
@app.route(‘/comments/‘,methods=[‘POST‘]) @loginFirst def comments(): comment=request.form.get(‘new_comment‘) questions_id =request.form.get(‘questions_id‘) author_id = User.query.filter(User.username == session.get(‘user‘)).first().id comments = Comment(detail=comment, author_id=author_id, questions_id=questions_id) db.session.add(comments) db.session.commit()
<input type="hidden" name="questions_id" value="{{ questions.id }}">
<h4>评论({{ questions.comments|length }})</h4>
@app.route(‘/comments/‘,methods=[‘POST‘]) @loginFirst
标签:列表 nts type 定义 input 获取 color session hid
原文地址:http://www.cnblogs.com/yuanyinglin/p/8003961.html