From 6790c434f75472ed3631a00f1dd6cfc456430b8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Kucharczyk?= Date: Tue, 31 Jan 2023 16:37:44 +0100 Subject: [PATCH] Order homepage sessions from newest --- games/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/games/views.py b/games/views.py index 4ed4a12..8e2cbed 100644 --- a/games/views.py +++ b/games/views.py @@ -87,7 +87,7 @@ def list_sessions(request, filter="", purchase_id="", platform_id="", game_id="" elif filter == "recent": dataset = Session.objects.filter( timestamp_start__gte=datetime.now() - timedelta(days=30) - ) + ).order_by("-timestamp_start") context["title"] = "Last 30 days" else: # by default, sort from newest to oldest