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

 

相关文章:

  • 2021-06-26
  • 2021-05-24
  • 2022-12-23
  • 2021-10-05
  • 2021-10-31
  • 2022-12-23
  • 2021-04-10
  • 2021-06-13
猜你喜欢
  • 2021-08-25
  • 2021-11-06
  • 2022-01-12
  • 2021-11-10
  • 2022-03-04
  • 2022-12-23
相关资源
相似解决方案