paginate organization type
This commit is contained in:
@@ -213,8 +213,11 @@ class OrganizationTypeViewSet(SoftDeleteMixin, ModelViewSet):
|
|||||||
def list(self, request, *args, **kwargs):
|
def list(self, request, *args, **kwargs):
|
||||||
""" all organization type """
|
""" all organization type """
|
||||||
queryset = self.get_queryset().order_by('-modify_date')
|
queryset = self.get_queryset().order_by('-modify_date')
|
||||||
serializer = self.serializer_class(queryset, many=True)
|
page = self.paginate_queryset(queryset.order_by('-create_date')) # paginate queryset
|
||||||
return Response(serializer.data, status=status.HTTP_200_OK)
|
|
||||||
|
if page is not None: # noqa
|
||||||
|
serializer = self.serializer_class(page, many=True)
|
||||||
|
return self.get_paginated_response(serializer.data)
|
||||||
|
|
||||||
|
|
||||||
class OrganizationViewSet(BaseViewSet, SoftDeleteMixin, ModelViewSet, DynamicSearchMixin):
|
class OrganizationViewSet(BaseViewSet, SoftDeleteMixin, ModelViewSet, DynamicSearchMixin):
|
||||||
|
|||||||
@@ -322,3 +322,4 @@ django.core.exceptions.FieldError: Unsupported lookup 'name' for ForeignKey or j
|
|||||||
[2025-10-28 14:28:55,553] INFO django.utils.autoreload | IP: - | Path: - | Watching for file changes with StatReloader
|
[2025-10-28 14:28:55,553] INFO django.utils.autoreload | IP: - | Path: - | Watching for file changes with StatReloader
|
||||||
[2025-10-28 14:35:00,268] INFO django.utils.autoreload | IP: - | Path: - | D:\Project\Rasaddam_Backend\apps\core\api.py changed, reloading.
|
[2025-10-28 14:35:00,268] INFO django.utils.autoreload | IP: - | Path: - | D:\Project\Rasaddam_Backend\apps\core\api.py changed, reloading.
|
||||||
[2025-10-28 14:35:02,391] INFO django.utils.autoreload | IP: - | Path: - | Watching for file changes with StatReloader
|
[2025-10-28 14:35:02,391] INFO django.utils.autoreload | IP: - | Path: - | Watching for file changes with StatReloader
|
||||||
|
[2025-10-28 14:55:17,922] INFO django.utils.autoreload | IP: - | Path: - | D:\Project\Rasaddam_Backend\apps\authentication\api\v1\api.py changed, reloading.
|
||||||
|
|||||||
Reference in New Issue
Block a user