On Wed, Apr 29, 2009 at 10:01 AM, j0s390 <murd3r...@gmail.com> wrote:
> > I want all usernames to have at most two underscores and the > underscores not to be consercutive... > I tried this by creating an ExtraRegForm(models.Model) and putting > username=models.CharField(min_length=4, max_length=16) > and tried the validation process by using re.search to see if username > meets the above standards and I failed. > Please help me... > > from django import forms > import re > > class ExtraRegForm(models.Model) > username=models.CharField(min_length=4, max_length=16) > > def clean(self): > # the check here (by regular expression or other) > > Help if you can.... > You would likely get better help if you were a bit more specific about the trouble you are running into. Are you unable to get your regex and re.search to work the way you want? If so, that's purely a Python thing and would be better asked about someplace like comp.lang.python. If, on the other hand, you are having trouble getting your custom form to be used, then that would be a Django problem to ask about here. But you'd have to include a lot more information about what you have done, what software exactly you are using (your use of the term 'registration' makes me think you may be using django-registration, but I'm not sure), and where things seem to be not working. Karen --~--~---------~--~----~------------~-------~--~----~ 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 django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---