(self)
return self.cleaned_data['username']
get user for this username
get user for this username
get user for this username
def clean_username(self):
        """ get user for this username """
        if 'username' in self.cleaned_data:
            try:
                self.user_cache = User.objects.get(
                        username = self.cleaned_data['username'])
            except:
                raise forms.ValidationError(_("Incorrect username."))
        return self.cleaned_data['username']
def clean_username ( self ) : if 'username' in self . cleaned_data : try : self . user_cache = User . objects . get ( username = self . cleaned_data [ 'username' ] ) except : raise forms . ValidationError ( _ ( "Incorrect username." ) ) return self . cleaned_data [ 'username' ]