fix - ordering organization type

This commit is contained in:
2025-10-28 13:53:19 +03:30
parent 7ffaff2c11
commit da4909ab68
2 changed files with 9 additions and 0 deletions

View File

@@ -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 """ #

View File

@@ -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