From 5b72453dc3aff60803ce072ea54eb464c44d3c12 Mon Sep 17 00:00:00 2001 From: W13R <9070224-W13R@users.noreply.gitlab.com> Date: Mon, 16 May 2022 11:00:24 +0200 Subject: [PATCH] Order drinks by product_name on the home page --- application/app/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/app/views.py b/application/app/views.py index 372a630..7e153be 100644 --- a/application/app/views.py +++ b/application/app/views.py @@ -65,7 +65,7 @@ def login_page(request): @login_required def index(request): context = { - "available_drinks": Drink.objects.filter(available__gt=0).filter(deleted=False), + "available_drinks": Drink.objects.filter(available__gt=0).filter(deleted=False).order_by('product_name'), } return render(request, "index.html", context)