def has_validator(field, validator_class):
    return any([
        isinstance(validator, validator_class)
        for validator in field.validators
    ])
Returns whether or not given field has an instance of given validator class
dataset/ETHPy150Open kvesteri/wtforms-components/wtforms_components/widgets.py/has_validator