Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Python by (47.6k points)

How can I order by descending my query set in Django by date?

Reserved.objects.all().filter(client=client_id).order_by('check_in')

I just want to filter from descending all the Reserved by check_in date.

1 Answer

0 votes
by (106k points)

You can use the below-mentioned command for Django order_by query set, ascending and descending:-

Reserved.objects.filter(client=client_id).order_by('-check_in')

Related questions

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...