Anthony:
. Thanks for submitting a patch.
*Quick Question:
With all of the below validations....
*1- Do they ALL execute
or
2- Execution stops at the first one that fails,
What I mean is say a user uses a username="bill"
the first validator will display the message, but does web2py continue to
evaluate the others?
*If so..
* Wouldn't it be wise to put the most likely validators at the beginning
of the list?
Thanks, I'm almost finished my example for this, just working on the "no
bad words" for username feature.
Rob
Rob
auth.settings.table_user.username.requires = [IS_LENGTH(30,6,'Please use
between 6 and 30 characters.'),
IS_MATCH('^[a-z0-9.]*$', error_message='Please use only letters (a-z)
and numbers (0-9), and periods.'),
IS_NOT_EMPTY(error_message='You can\'t leave this empty. '),
IS_EXPR("value[0]<>'.'", error_message='The FIRST character of your
username should be a letter (a-z) or number.'),
IS_EXPR("value[-1]<>'.'", error_message='The LAST character of your
username should be a letter (a-z) or number.'),
IS_EXPR("str(value).find('..')==-1",error_message='A fan of
punctuation! Alas, usernames can\'t have consecutive periods.'),
IS_NOT_IN_DB(db, auth.settings.table_user.username, 'Someone already
has that username. ')
]
--