4👍
✅
You’ll probably need to fallback to Django’s extra function. Perhaps:
ordered = (qs.extra(select={"order_column": "CONVERT(column, INTEGER)"})
.order_by("order_column"))
(Assuming you’re using MySQL)
Source:stackexchange.com