1
How to recover values from html elements in a custom validation with Django-Rest ?
How would Django-Rest the similarity with 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’ve tried with the ( validate_password1(self, date):), but I don’t know how to recover the value of password2.
I’ve also tried with (to_internal_value), but I need the feedback as in validate_CAMPO. Example (Field:msg error)