I am using newforms for user registration module. How do I check if
username isAlphaNumeric ?

Where do I use validator_list?

class UserProfileForm(forms.Form):
   username = forms.CharField(max_length=30)
   password1 = forms.CharField(widget=PasswordInput)
.... ... ... ..
... ... ..... ...

   def clean_username(self):
      if self.clean_data.get('usename'):
        u = self.clean_data['username']
        try:
         User.objects.get(username=u)
       except User.DoesNotExist:
         return
       raise ValidationError(u'Username %s is already taken.' % u)


Thanks


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to