I need to disable field validation in ModelForm. I want this validation not to validate some field. I have some situations (AJAX rendering form) when I want to return more complex form with additional fields. I pass POST to the form and render new one with post fields saved. Some new fields are added and they can't be validated. I pass flag to form and recognize when it happens. Should I make it in some clean functions?
Just override the validation function with empty function
previousReportIdNotEqual=forms.MultipleChoiceField(required=False)
def empty(self):
pass
previousReportIdNotEqual.validate=empty
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With