1👍
✅
def clean_book_name(self):
book_name = self.cleaned_data['book_name']
if not book_name:
raise forms.ValidationError('field mandatory')
return book_name
Source:stackexchange.com