#6 A FieldsDifferent and a improved DateConvertor

open
nobody
None
5
2010-08-05
2010-08-05
Anonymous
No

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.

Discussion

  •  
    Attachments