我是一個noobie,我有複選框和一個下拉列表,我使用request.form.getlist(「」)檢索了這些值。如果複選框的值不存在下拉列表的值,我想繼續進一步操作。燒瓶中的驗證
try:
if drop not in check:
return render_template('index.html')
except Exception:
return render_template('error.html')
始終運行index.html的,即使降值出現在檢查, 卻不是因使用wtforms。 我應該如何驗證它?在此先感謝
究竟是什麼'drop'和'check'?你有什麼樣的例外,希望它跳到「except」塊? – glibdud
包含下拉列表和複選框值的變量,它只是在引發異常時彈出警告 – rey