From da4909ab688001880f2ca2c92867c90d6f364793 Mon Sep 17 00:00:00 2001 From: Mojtaba-z Date: Tue, 28 Oct 2025 13:53:19 +0330 Subject: [PATCH] fix - ordering organization type --- apps/authentication/api/v1/api.py | 6 ++++++ logs/django_requests.log | 3 +++ 2 files changed, 9 insertions(+) diff --git a/apps/authentication/api/v1/api.py b/apps/authentication/api/v1/api.py index 5c03cc7..ae4352d 100644 --- a/apps/authentication/api/v1/api.py +++ b/apps/authentication/api/v1/api.py @@ -210,6 +210,12 @@ class OrganizationTypeViewSet(SoftDeleteMixin, ModelViewSet): queryset = OrganizationType.objects.all() serializer_class = OrganizationTypeSerializer + def list(self, request, *args, **kwargs): + """ all organization type """ + queryset = self.get_queryset().order_by('-modify_date') + serializer = self.serializer_class(queryset, many=True) + return Response(serializer.data, status=status.HTTP_200_OK) + class OrganizationViewSet(BaseViewSet, SoftDeleteMixin, ModelViewSet, DynamicSearchMixin): """ Crud operations for organization model """ # diff --git a/logs/django_requests.log b/logs/django_requests.log index e5611c5..58edc77 100644 --- a/logs/django_requests.log +++ b/logs/django_requests.log @@ -309,3 +309,6 @@ django.core.exceptions.FieldError: Unsupported lookup 'name' for ForeignKey or j [2025-10-28 10:24:56,044] INFO django.utils.autoreload | IP: - | Path: - | D:\Project\Rasaddam_Backend\apps\authentication\api\v1\api.py changed, reloading. [2025-10-28 10:25:01,182] INFO django.utils.autoreload | IP: - | Path: - | Watching for file changes with StatReloader [2025-10-28 13:50:35,064] INFO django.utils.autoreload | IP: - | Path: - | D:\Project\Rasaddam_Backend\apps\authorization\api\v1\api.py changed, reloading. +[2025-10-28 13:50:37,425] INFO django.utils.autoreload | IP: - | Path: - | Watching for file changes with StatReloader +[2025-10-28 13:53:02,285] INFO django.utils.autoreload | IP: - | Path: - | D:\Project\Rasaddam_Backend\apps\authentication\api\v1\api.py changed, reloading. +[2025-10-28 13:53:05,015] INFO django.utils.autoreload | IP: - | Path: - | Watching for file changes with StatReloader