Game View: order editions by year

This commit is contained in:
Lukáš Kucharczyk 2023-11-14 21:19:36 +01:00
parent 729e1d939b
commit 8982fc5086
1 changed files with 3 additions and 1 deletions

View File

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