In this video, we'll cover how to add custom validation on Django form fields.
The clean_fieldname() method is called on a form subclass – where "fieldname" is replaced with the name of the form field attribute. This method does any cleaning that is specific to that particular attribute, unrelated to the type of field that it is. This method is not passed any parameters. You will need to look up the value of the field in self.cleaned_data and remember that it will be a Python object at this point, not the original string submitted in the form (it will be in cleaned_data because the general field clean() method, above, has already cleaned the data once).
Helpful links
https://docs.djangoproject.com/en/2.2...
https://docs.djangoproject.com/en/2.2...
https://gist.github.com/michenriksen/...
Watch video How to Add Custom Validation on Django Form Fields online, duration hours minute second in high quality that is uploaded to the channel Jarad Python 17 May 2019. Share the link to the video on social media so that your subscribers and friends will also watch this video. This video clip has been viewed 8,504 times and liked it 98 visitors.