'Show particular records at the bottom in webpage

I have drf website where i am showing the records of some sought on my website i have 4 different type of statuses on my webpage for records how do i show a particular status records related to the records at the bottom.

class MyListView(APIView):


Solution 1:[1]

try this

qs = Model.objects.extra(select={'bottom_status': "status = Closed"})
qs = qs.extra(order_by=['bottom_status'])

https://docs.djangoproject.com/en/4.0/ref/models/querysets/#django.db.models.query.QuerySet.extra

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 rahul.m