From 7a2bc779f6415a52e8a6211c688fc21b65a180fe Mon Sep 17 00:00:00 2001 From: james1293 Date: Fri, 16 Aug 2019 14:42:35 -0400 Subject: [PATCH] Sort by group name instead of group id --- todo/views/list_lists.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/todo/views/list_lists.py b/todo/views/list_lists.py index d8b7bea..45a9836 100644 --- a/todo/views/list_lists.py +++ b/todo/views/list_lists.py @@ -28,10 +28,10 @@ def list_lists(request) -> HttpResponse: # Superusers see all lists if request.user.is_superuser: - lists = TaskList.objects.all().order_by("group", "name") + lists = TaskList.objects.all().order_by("group__name", "name") else: lists = TaskList.objects.filter(group__in=request.user.groups.all()).order_by( - "group", "name" + "group__name", "name" ) list_count = lists.count()