

@classmethod
def _fields_to_index(cls):
    fields = []
    for field in cls._meta.sorted_fields:
        if field.primary_key:
            continue
        requires_index = any((field.index, field.unique, isinstance(field, ForeignKeyField)))
        if requires_index:
            fields.append(field)
    return fields

dataset/ETHPy150Open coleifer/peewee/peewee.py Model._fields_to_index/original