def has_index(self, column):
        """
        Whether or not given column has an index.

        :param column: Column object to inspect the indexes from
        """
        if column.primary_key or column.foreign_keys:
            return True
        table = column.table
        for index in table.indexes:
            if len(index.columns) == 1 and column.name in index.columns:
                return True
        return False
dataset/ETHPy150Open kvesteri/wtforms-alchemy/wtforms_alchemy/generator.py/FormGenerator.has_index/original