0

按照我的形式:

class FlightRequestForm(FlaskForm):
    departure_cities = SelectMultipleField('Departure Cities ', choices=DEPARTURE_CITIES, validators=[DataRequired()]) 
    destination_city = StringField('Destination City', validators=[DataRequired()]) 
    earliest_departure_date = StringField('Earliest Departure Date [dd/mm/yyyy]', validators=[DataRequired()]) 
    min_nights_in_dst = IntegerField('Minimal Length of Stay') 
    submit = SubmitField("Search Flights")

和 html 文件:

{% extends 'bootstrap/base.html' %}
{% import "bootstrap/wtf.html" as wtf %}

{% block content %}
{% include "header.html" %}
<div class="container-fluid projectBoard">
  <div class="container">
      <div class="row">
          <div class="col-lg-8 col-md-10 mx-auto">
              <h1>New task</h1>
          </div>
      </div>
      <div class="row">
          <div class="col-lg-8 col-md-10 mx-auto">
              {{ ckeditor.load() }}
              {{ ckeditor.config(name='body') }}
              {{ wtf.quick_form(form, novalidate=True, button_map={"submit": "primary"}) }}
          </div>
      </div>
  </div>
</div>

{% include "footer.html" %}
{% endblock %}

我收到以下错误消息:

ValueError:要解包的值太多(预期为 2)

为了

 {{ wtf.quick_form(form, novalidate=True, button_map={"submit": "primary"}) }}

我怎样才能“添加大小”?

4

0 回答 0