tags:

views:

8

answers:

1

hi.. i have the following form class with corresponding clean methods...

class SOFIATMUserLogin(forms.Form): Username=forms.CharField(label='Username') Password=forms.CharField(label='Password', widget=forms.PasswordInput)

def clean_Username(self): user=self.cleaned_data['Username'] try: SOFIALogin.objects.get(UserName=user) except Exception: raise forms.ValidationError('Username invalid...')

def clean_Password(self): upass=self.cleaned_data['Password']

In the clean_Password method i wish to check if the password entered for the valid username is correct... So i need to get the Username value... How can i access this in clean_Password method... Please assist!!!!

A: 

Hi, if i understand your question, you just need: self.cleaned_data['Username']

Saff
Okie.. .Thanks :)
apoorva