I'm trying to write a query in Peewee for MySQL and I'd like to do something similar to the solution offered here: Sort by order of values in a select statement "in" clause in mysql
That is, I'd like to select a table using a WHERE clause and an IN operator.
However, rather than have the results ordered based on value(s) found in these tables, I'd like them to arrange them in the same order they're found in the list or operator I provide.
The alternative I'm using now is to simply loop through and accumulate on another list, but this takes much longer (~50-70% more time than just a simple query with an order_by).
Is there a way to do this more elegantly in Peewee?