私はユーザーが検索したデータをレンダリングするページを持っています。私は、ユーザーがページの側面でいつでも検索資格情報を変更できるようにしたいと考えています。なんらかの理由で、それは「学校の変更」のためだけに働いています。コードが他の検索フィールドに到達しないのはなぜですか(たとえば、検索タイプを変更すると何も起こりませんし、コンソールに何も表示されません)。インデントエラーを無視してください。更新された検索フォームの処理
関連HTML:(テキストフィールドのすべての名前/ IDは確かにPythonコードのものと一致)
<form id="update" name="update" method="post" action="/find-it/">
<input type="submit" value="search" id="enter" form="update">
PYTHON:
if request.method == 'POST':
if "updateSchool" in request.form:
print('school changed')
school = request.form['updateSchool']
data = updateSchool(school)
return render_template('testBrowse.html', data=data)
elif "updateType" in request.form:
print('type changed')
newType = request.form['updateType']
data = updateType(newType)
print('getting to update type')
return render_template('testBrowse.html', data=data)
elif "updateTitle" in request.form:
print('title changed')
newTitle request.form['updateTitle']
data = updateTitle(newTitle)
return render_template('testBrowse.html', data=data)
return render_template('testBrowse.html', data=data)
ありがとうございました! – user3344239