auth.define_tables(username=True) db.auth_user.username.requires.insert(0,IS_MATCH("[a-z].*"))
On Monday, 6 August 2012 08:22:07 UTC-5, Rob_McC wrote: > > I notice that several characters are not allowed in web2py user names, > like ~ and !, > but "." (period) and "-" are allowed. > > Quick Question: > Is there an easy way to restrict usernames to only allow a-z as first > letter? > > *Reason:* > I will have other uses for the url with . and - in them. > > *Reference: > * > gmail signup > The first character of your username should be a letter (a-z) or number. > > Thanks, sure enjoying web2py and learning Python and this user forum. > ------- > *Notes:* > I have this in > */models/db.py* > > # require username, not email on signup > > auth.define_tables(username=True) > > > I did see this about adding a character.. > > https://groups.google.com/forum/?fromgroups#!searchin/web2py/first$20character$20of$20username/web2py/9K4PTFuTNtA/s_uIneT4fzIJ > > > --