How to retrieve values from html elements in a custom validation with Django-rest?
How would django-rest be similar to the code below?
def clean(self):
password1 = self.cleaned_data.get('password1')
password2 = self.cleaned_data.get('password2')
if password1 and password1 != password2:
raise forms.ValidationError("Passwords don't match")
return self.cleaned_data
I have tried with passcode1 (self, date):
I've also tried with ( to_internal_value ), but I need the return as in validate_CAMPO . Example (Field: error msg)