In my forms, if I have the following class with a field for my charfield 'bio'
class MyClass(forms.ModelForm):
bio = forms.CharField(max_length=1000
Do I need to have the below validation or does the above max_length=1000 already cover that?
def clean_bio(self):
bio=self.cleaned_data['bio']
max_length = 1000
if len(bio) > max_length:
raise forms.ValidationError('Please limit your bio to 1000 words')
return bio