我只想定义必须使用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'