开发者

How to check why form is not valid

开发者 https://www.devze.com 2023-01-05 15:51 出处:网络
I have some troublesome form in my django app. Problem is that it doesn\'t validate. How can I check what is causing the problem ? I\'ve tried the following :

I have some troublesome form in my django app. Problem is that it doesn't validate. How can I check what is causing the problem ? I've tried the following :

form.data = {dictionary_with_data}  
form.is_valid()  
False  
form._errors  
{}  
form.errors  
开发者_如何学Python{}  
Form.non_field_errors()  
[]  


Try this

form = YourForm(data={dict_with_data})
0

精彩评论

暂无评论...
验证码 换一张
取 消