

def prepared(self):
    if self.order_by:
        norm_order_by = []
        for item in self.order_by:
            if isinstance(item, Field):
                prefix = ('-' if (item._ordering == 'DESC') else '')
                item = (prefix + item.name)
            field = self.fields[item.lstrip('-')]
            if prefix.startswith('-'):
                norm_order_by.append(field.desc())
            else:
                norm_order_by.append(field.asc())
        self.order_by = norm_order_by

dataset/ETHPy150Open coleifer/peewee/peewee.py ModelOptions.prepared/VarMisuse@83/97 `item`->`prefix`