try: result = [checker(x) for checker in checkerlist ] catch something
这是自己实现的,
更完善的就要用 高阶的form library和 model 进行校验
binux
2014-03-28 11:24:36 +08:00
check_funcs = [check_username, check_password, check_email, ] for each in check_funcs: __try: ____ret = each(from_data) __except Exception, e: ____ret = False __if ret is not True: ____raise Error