Newbie - I'm trying to call clean_title_length to error on length title is less than 3 characters or more than 25 characters.
I tried using MinLengthValidator, but it did not work.
title = models.CharField(max_length=255)
url = models.URLField()
youtube_id = models.CharField(max_length=255)
data = self.cleaned_data['title']
if length < 3 or length > 25:
raise ValidationError("The length of the title must be between 3 and 25 characters")
form = VideoForm()
if request.method == 'POST':
filled_form = VideoForm(request.POST)
Form always come back valid.
Could you give me a snippet that would show error message above the text box saying title between 3 and 25 characters?