[AF] My form data is showing up in the textarea <wrapped in brackets like this> and I don't know how to resolve
Hi all,
Obviously I'm new at this. I have a form. I send it data like so via the route:
@app.route('/edit_log/<postId>', methods=['GET', 'POST'])
@login_required
def edit_log(postId):
#get the data from the database to show in the form
postData = Post.query.filter_by(id=postId).first()
form = EditPostForm()
if form.validate_on_submit():
post = Post(body=form.post.data, author=current_user)
db.session.commit()
flash('Your changes have been saved.')
return redirect(url_for('org'))
elif request.method == 'GET':
#fill the form data with the actual post info from the above query
form.post.data = postData
return
/r/flask
https://redd.it/a7ivpg
Hi all,
Obviously I'm new at this. I have a form. I send it data like so via the route:
@app.route('/edit_log/<postId>', methods=['GET', 'POST'])
@login_required
def edit_log(postId):
#get the data from the database to show in the form
postData = Post.query.filter_by(id=postId).first()
form = EditPostForm()
if form.validate_on_submit():
post = Post(body=form.post.data, author=current_user)
db.session.commit()
flash('Your changes have been saved.')
return redirect(url_for('org'))
elif request.method == 'GET':
#fill the form data with the actual post info from the above query
form.post.data = postData
return
/r/flask
https://redd.it/a7ivpg
reddit
r/flask - [AF] My form data is showing up in the textarea and I don't know how to resolve
1 vote and 1 comment so far on Reddit