0👍
✅
All you have to do is this:
all_server_id = Session.objects.filter(user_id=request.user.id).order_by('-make_default')
I believe that answers your question from the comments.
1👍
If you want to sort a query, you should use order_by() function, ex:
all_server_id = Session.objects.filter(user_id=request.user.id).order_by('make_default')
- [Answer]-How simple bound jQuery ajax and Django?
- [Answer]-How to avoid cleaned_data for each field if I have too many fields in the form
Source:stackexchange.com