import - quota dashboard & some changes in product quota stat

This commit is contained in:
2025-12-07 15:50:35 +03:30
parent 3a768e8b13
commit 6491c53306
6 changed files with 224 additions and 128 deletions

View File

@@ -212,6 +212,8 @@ class OrganizationTypeViewSet(BaseViewSet, SoftDeleteMixin, ModelViewSet):
""" Crud operations for Organization Type model """ #
queryset = OrganizationType.objects.all()
serializer_class = OrganizationTypeSerializer
filter_backends = [filters.SearchFilter]
search_fields = ['name']
def list(self, request, *args, **kwargs):
""" all organization type """
@@ -226,6 +228,7 @@ class OrganizationTypeViewSet(BaseViewSet, SoftDeleteMixin, ModelViewSet):
elif org_type_field == 'CO':
queryset = self.get_queryset().filter(org_type_field=org_type_field).order_by('-modify_date')
queryset = self.filter_queryset(queryset) # noqa
page = self.paginate_queryset(queryset.order_by('-create_date')) # paginate queryset # noqa
if page is not None: # noqa
serializer = self.serializer_class(page, many=True)