In my application i have table called "Task". In this table there is a field called priority with a restricted choice of ("High", "Medium", "Low"). I have ordered these by priority which have an order of: High, Low, Medium when i would like the order to be High, Medium, Low. How could i swap Low and Medium inside the querySet around?
views.py:
tasks = Tasks.objects.values("priority").annotate(count=Count("priority"))
output:
<QuerySet [{'priority': 'High', 'count': 3}, {'priority': 'Low', 'count': 3}, {'priority': 'Medium', 'count': 3}]>
desired output:
<QuerySet [{'priority': 'High', 'count': 3}, {'priority': 'Medium', 'count': 3}, {'priority': 'Low', 'count': 3}]>