[Answer]-How to sort a django query with a specific value?

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')

Leave a comment