I keep numeric fields like “size”, “width”, “height” in my database. Now I would attach units like “KiB” or “pixels” to them when showing them in the change list. This could easily be achieved by adding callables such as “size_formatted” etc to list_display. However, these are no longer sortable.
Is there a way around this limitation?
Read here – ModelAdmin.list_display (read a lot to get to the point 😉 )
you need to add admin_order_field attribute to your function