

def required_validator(self, column):
    '\n        Returns required / optional validator for given column based on column\n        nullability and form configuration.\n\n        :param column: SQLAlchemy Column object\n        '
    if ((not self.meta.all_fields_optional) and (not column.default) and (not column.nullable)):
        type_map = self.meta.not_null_validator_type_map
        try:
            return type_map[column.type]
        except KeyError:
            if isinstance(type_map.type, sa.types.TypeDecorator):
                type_ = column.type.impl
                try:
                    return type_map[type_]
                except KeyError:
                    pass
            if (self.meta.not_null_validator is not None):
                return self.meta.not_null_validator
    return self.get_validator('optional')

dataset/ETHPy150Open kvesteri/wtforms-alchemy/wtforms_alchemy/generator.py FormGenerator.required_validator/VarMisuse@71/143 `column`->`type_map`