python - WTForm always return False -
i'm using wtforms json validation
:
forms.py
class vcodeform(form): type = textfield('type', [validators.length(min=4, max=25)])
views.py
@app.route('/vcode', methods = ['get']) def vcode(): form = vcodeform(request.args) return str(form.validate())
args(using httpie tool)
http --session=s1 localhost:5000/vcode type==register
the value returned flase
, print value of form.type.data
<input id="type" name="type" type="text" value="register">
where did wrong?
i found solution using json validation
it's great , easy understand.
Comments
Post a Comment