Game View: order editions by year

This commit is contained in:
Lukáš Kucharczyk 2023-11-14 21:19:36 +01:00
parent ab9c1d61dd
commit c8e8ba8c8e
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) game = Game.objects.get(id=game_id)
context["title"] = "View Game" context["title"] = "View Game"
context["game"] = 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 = ( game_purchases = (
Purchase.objects.filter(edition__game_id=game_id) Purchase.objects.filter(edition__game_id=game_id)
.filter(type=Purchase.GAME) .filter(type=Purchase.GAME)