首页 > 其他 > 详细

django 自定义数据校验

时间:2015-03-12 00:38:56      阅读:308      评论:0      收藏:0      [点我收藏+]

http://stackoverflow.com/questions/16231183/django-how-to-override-clean-method-in-a-subclass-of-custom-form

 1 class SubClassForm(MyCustomForm):
 2 # ... additional form fields here
 3 
 4 def clean(self):
 5     # Then call the clean() method of the super  class
 6     cleaned_data = super(SubClassForm, self).clean()
 7     # ... do some cross-fields validation for the subclass 
 8 
 9     # Finally, return the cleaned_data
10     return cleaned_data

 

django 自定义数据校验

原文:http://www.cnblogs.com/tk091/p/4331331.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!