specialchar_list = ['!','@','#','$','%','^','&','*','(',')','-','_','=','+','{','}','[',']']
def validate_password(field_data, all_data):
                if len(field_data) < 8:
                         raise validators.ValidationError("Passwords must be a least 8 characters long.")
                # is it sas 70 compliant?

                passcount = 0
                if re.search('[A-Z]', field_data):
                        passcount = passcount + 1

                if re.search('[a-z]', field_data):
                        passcount = passcount + 1

                if re.search('[0-9]', field_data):
                        passcount = passcount + 1

                # does it contain special characters?
                for char in field_data:
                        if char in specialchar_list:
                                passcount = passcount + 1
                                break

                if passcount < 3:
                        raise validators.ValidationError("Passwords must contain three of the following four:<br>&nbsp;&nbsp;&nbsp;Uppercase, Lowercase, Number, Special Character.")