из формы в переменную shape
HTML:
<p>{{ form.shape.label }}: {{ form.shape() }}</p>
app.py
class ColorForm(FlaskForm):
shape = SelectField("Collage shape", choices=[("Normal", "Normal"),("Plasma", "Plasma"))], validators=[DataRequired()])
def index():
shape = ??????????
def index(): form = ColorForm() if form.validate_on_submit(): print(form.shape)
Обсуждают сегодня