0
@app.route("/check", methods=['GET', 'POST'])
def Input():
    form = CheckForm()
    if request.method == 'POST':
        check_no = form.check.data
        check_list = [check_no]
        return redirect(url_for('app.output', check_list=check_list))
    return render_template("check.html", form=form)

@app.route('/returncheck', methods=['GET', 'POST'])
def Output(check_list):
    print(check_list)

What I am trying to do here is pass the check_list in Input() to the function Output(check_list) The Input POST seems to be working fine and receiving user input, however I am struggling to pass this list that I have created from the user input to the Output function. I have tried a couple of things like:

@app.route('/results/<check_list>/', methods=['GET', 'POST'])
def Output(check_list):
    print(check_list)

But this only worked when I didn't convert the user input into a list. So it worked with check_no but not with check_list. Is there a reason for this?

davidism
  • 110,080
  • 24
  • 357
  • 317

0 Answers0