From 5edfee9c0b60b33162fc87dc33582b751ce34087 Mon Sep 17 00:00:00 2001 From: AlanJaeger Date: Tue, 3 Dec 2024 16:11:23 -0300 Subject: [PATCH] feature: order tags by name --- chats/apps/api/v1/internal/sectors/viewsets.py | 2 +- chats/apps/api/v1/sectors/viewsets.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/chats/apps/api/v1/internal/sectors/viewsets.py b/chats/apps/api/v1/internal/sectors/viewsets.py index 1d536413..f7a93941 100644 --- a/chats/apps/api/v1/internal/sectors/viewsets.py +++ b/chats/apps/api/v1/internal/sectors/viewsets.py @@ -80,7 +80,7 @@ def perform_destroy(self, instance): class SectorTagsViewset(viewsets.ModelViewSet): - queryset = SectorTag.objects.all() + queryset = SectorTag.objects.all().order_by("name") serializer_class = SectorTagSerializer permission_classes = [IsAuthenticated, ModuleHasPermission] filter_backends = [DjangoFilterBackend] diff --git a/chats/apps/api/v1/sectors/viewsets.py b/chats/apps/api/v1/sectors/viewsets.py index d084a7a0..823254a2 100644 --- a/chats/apps/api/v1/sectors/viewsets.py +++ b/chats/apps/api/v1/sectors/viewsets.py @@ -189,7 +189,7 @@ def authorization(self, request, *args, **kwargs): class SectorTagsViewset(viewsets.ModelViewSet): - queryset = SectorTag.objects.all() + queryset = SectorTag.objects.all().order_by("name") serializer_class = sector_serializers.SectorTagSerializer filter_backends = [DjangoFilterBackend] filterset_class = SectorTagFilter