From 8982fc5086973c4ee66e7dcdacc65912993f6f15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Kucharczyk?= Date: Tue, 14 Nov 2023 21:19:36 +0100 Subject: [PATCH] Game View: order editions by year --- games/views.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/games/views.py b/games/views.py index c859d5f..b614953 100644 --- a/games/views.py +++ b/games/views.py @@ -140,7 +140,9 @@ def view_game(request, game_id=None): game = Game.objects.get(id=game_id) context["title"] = "View Game" context["game"] = game - context["editions"] = Edition.objects.filter(game_id=game_id) + context["editions"] = Edition.objects.filter(game_id=game_id).order_by( + "year_released" + ) game_purchases = ( Purchase.objects.filter(edition__game_id=game_id) .filter(type=Purchase.GAME)