아래의 내 특정 문제에 관계없이 동일한 페이지의 사용자 게시물에 여러 번 응답하는 효과적인 방법은 무엇입니까? 따라서 페이지의 각 프로그레시브 포스트에서 새 요청을 캡처하고 새로운 정보를 표시 할 수 있습니까? 문제를 제대로 설명하지 못하면 용서하십시오.사용자 게시물에 대한 답변
사용자가 반응하는 페이지를 만들려고합니다. 하지만 난 실행 해요 :
잘못된 요청
브라우저 (또는 프록시) 보냈이 서버가 이해할 수 없다는 요청이.
때문에 나는 내 현재 솔루션에 같은데요 :
@app.route('/survey', methods = ['GET', 'POST'])$
@contributer_permission.require(403)$
def survey():
organization_id = None
survey_header_id = None
survey_section_id = None
organization_selected = None
survey_header_selected = None
survey_section_selected = None
if request.method== 'POST':
if not organization_id:
organization_id = request.form['organization_id']
organization_selected = Organization.query.get(organization_id)
elif not survey_header_id:
survey_header_id = request.form['survey_header_id']
survey_header_selected = SurveyHeader.query.get(survey_header_id)
elif not survey_section_id:
pass
else:
pass
return render_template('survey.html',
organization_class = Organization,
organization_selected = organization_selected,
organization_id = organization_id,
survey_header_id = survey_header_id,
survey_header_selected = survey_header_selected,
survey_section_id = survey_section_id,
survey_section_selected = survey_section_selected)
을 내가 survey_header_id를 들고 게시물을 받으면. 그것은이
{% extends "base.html" %}
{% block content %}
<div class ="entries"> <!-- should be a DIV in your style! -->
<form action="{{url_for('survey') }}" method="post" class="add-entry"/>
<dl>
{% if not organization_id %}
{% for organization in organization_class.query.all() %}
<dt><input type="radio", name="organization_id",
value="{{ organization.id }}"/>{{ organization.name }}</dt>
{% endfor %}
<dt><input type ="submit", name="submit_organization"/>
{% elif not survey_header_id %}
<h1>{{ organization_selected.name }}</h1>
{% for survey_header in organization_selected.survey_headers.all() %}
<dt><input type="radio", name="survey_header_id"
value="{{ survey_header.id }}"/>{{ survey_header.name }}
{% endfor %}
<dt><input type ="submit", name="submit_survey_header"/>
{% elif not survey_section_id %}
<p>hi</p>
{% else %}
{% endif %}
<dl>
</form>
</div>
{% endblock %}
내가 무슨 일을해야 첨부 된 HTML/JSON이며 여기에 reloops 및
organization_id becomes none
?