From d9290373b0a57ec7fb7e70240bd6a258dd954113 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Kucharczyk?= Date: Fri, 18 Oct 2024 09:50:10 +0200 Subject: [PATCH] also sort purchases by created_at --- games/views/purchase.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/games/views/purchase.py b/games/views/purchase.py index 7ca1f94..005f08f 100644 --- a/games/views/purchase.py +++ b/games/views/purchase.py @@ -26,7 +26,7 @@ def list_purchases(request: HttpRequest) -> HttpResponse: context: dict[Any, Any] = {} page_number = request.GET.get("page", 1) limit = request.GET.get("limit", 10) - purchases = Purchase.objects.order_by("-date_purchased") + purchases = Purchase.objects.order_by("-date_purchased", "-created_at") page_obj = None if int(limit) != 0: paginator = Paginator(purchases, limit)