There are four field in django form and i am using is_valid() function to validate, but instead of validating the whole form i want to exclude one field which should not be validate using is_valid() function
You can use exclude parameter inside your form to exclude the fields you don't want to get validated.
Let's say you have a model named MyModel and a model form for it named MyForm
# forms.py
from django import forms
from .models import MyModel
class MyForm(forms.ModelForm):
class Meta:
model = MyModel
exclude = ['field_name_you_want_to_exclude']
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