其他字段范围内的字段输入

时间:2019-06-18 16:49:44

标签: python flask flask-wtforms wtforms

我只想定义必须使用flask-wtforms和NumberRange验证程序动态验证输入的范围,但是出现错误。

class NumberForm(FlaskForm):
    min_value = IntegerField('Minimal value', validators=[DataRequired()])
    max_value = IntegerField('Maximal value', validators=[DataRequired()])
    desire_point = IntegerField('Point', validators=[DataRequired(),
                                                NumberRange(min=min_value, max=max_val, message='Problem')])
    submit = SubmitField('Add')

TypeError: '<' not supported between instances of 'int' and 'UnboundField'

0 个答案:

没有答案