Re: [web2py] Enforcing - like gmail: first character of your username should be a letter (a-z) or number.
On 14 Aug 2012, at 8:11 AM, Rob_McC wrote: > Hey Jon: > > Q: > > BTW, are you deliberately forbidding upper-case letters? > > A: > . Yes, just like Google does, usernames are lowercase, >although if your gmail username is >johnsmith >you can log in with >JohnSmith, or >JOHNSMITH, or >Johnsmith > etc. but there is ONLY ONE user. > > At least for my app, Just case lowercase names are best... > user's have enough trouble remembering names without burden of > case-sensitivity. An alternative is to let the user enter any case, but append the IS_LOWER validator, which isn't a validator, but forces the field to lower case. --
[web2py] Enforcing - like gmail: first character of your username should be a letter (a-z) or number.
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 --