

def coerce(self, column):
    '\n        Returns coerce callable for given column\n\n        :param column: SQLAlchemy Column object\n        '
    if ('coerce' in column.info):
        return column.info['coerce']
    if isinstance(column.type, types.ChoiceType):
        return choice_type_coerce_factory(column.type)
    try:
        python_type = column.type.python_type
    except NotImplementedError:
        return null_or_unicode
    if (column.nullable and issubclass(python_type, six.string_types)):
        return null_or_unicode
    return python_type

dataset/ETHPy150Open kvesteri/wtforms-alchemy/wtforms_alchemy/generator.py FormGenerator.coerce/original