I am trying to find a way to display a list of database objects in an order based on their status
variable. The application is an order tracking app. Each order has a status: 'idle', 'awaiting delivery', 'ready for pickup', etc. I'm wanting to display the list of orders, sorted by their status. I already have a filter that is working, but I'm wondering if there is a way to sort the entire list of orders such that 'idle' orders are on top, followed by 'awaiting delivery' orders, and so on. Obviously, I can't just add status
to ordering
in the admin.py
file, because that sorts statuses alphabetically.
Does anybody know a simple way to fix this issue? I'm sure I'm just over-thinking this whole thing..