

def get_field_class(self, column):
    '\n        Returns WTForms field class. Class is based on a custom field class\n        attribute or SQLAlchemy column type.\n\n        :param column: SQLAlchemy Column object\n        '
    if (('form_field_class' in column.info) and column.info['form_field_class']):
        return column.info['form_field_class']
    if (('choices' in column.info) and column.info['choices']):
        return SelectField
    if ((column.type not in self.TYPE_MAP) and isinstance(column.type, sa.types.TypeDecorator)):
        check_type = column.type.impl
    else:
        check_type = column.type
    try:
        column_type = self.TYPE_MAP[check_type]
        if (inspect.isclass(column_type) and issubclass(column_type, Field)):
            return column_type
        else:
            return column_type(column)
    except KeyError:
        raise UnknownTypeException(column)

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