django forms - clean method for validation -
I have the following categories of which the clean methods ...
class SOFIATMUserLogin (form): user name = forms. Kharefield (label = 'username') password = forms. Kharefield (label = 'password', widget = forms. Password input) def clean_Username (self): user = self.cleaned_data ['UserName']: Except exceptions SOFIALogin.objects.get (UserName = User): forms.ValidationError ('User Name Invalid ...') def clean _Password (self): upass = self.cleaned_data ['password']
In the clear password method, I want to know whether the password is correct for a valid user name ... I need to get the user name value ... how can I get it in the pure password method ... please help
If I understand your question, then you just need to: self.cleaned_data ['username']
Comments
Post a Comment