I am not sure if this is programmatically possible with one query statement. I am using sqlAlchemy order_by with a case statement and I currently have
query =