flask 中from.validate_on_submit()的作用

if   from.validate_on_submit():

        #处理的逻辑操作

上面等价于:

if  request.method==' post '  and  from.validate():

        #处理的逻辑操作

validate是验证数据的意思

所以from.validate_on_submit()等价于   request.method==' post '  and  from.validate()

    

发布了70 篇原创文章 · 获赞 25 · 访问量 4万+

猜你喜欢

转载自blog.csdn.net/a66666_/article/details/103301562