Nobody/Anonymous
-
2010-08-05
Checking is the password same as user id is important. But formencode only provide FieldsMatch, so that I write a FieldsDifferent which is for making sure there are no fields have same value. A simple example:
passwordValidator = Schema(
chained_validators=(
FieldsDifferent(
'id',
'password',
messages={'invalid': l_("Password should be different from ID")}
)
)
)
I also wrote a better DateConvertor which can support not only mm/dd/yy or dd/mm/yy format. People in some country, like Taiwan used to use YYY/MM/DD. Here I attached the file in this post.