Сериализаторы для Нормативки и главной страницы не доделаны
This commit is contained in:
Nukeap committed 2024-05-17 15:45:47 +03:00
1 parent 4090ee1fb9
commit 175e6ce59f
21 files changed
+422 -235

No files matched your search

+21 -18
View File
@@ -15,27 +15,30 @@ class SafetyTypeAPIView(ListAPIView):
chapters = SafetyType.objects.annotate(Count("type_file")).filter(type_file__count__gt=0)
return Response(SafetyTypeSerializer(chapters, many=True).data)
class SafetyFileAPIView(APIView):
def get(self, request):
chapters = self.request.query_params.get('chapter', "fire_safety")
safety_group = SafetyType.objects.get(path=chapters)
return Response(SafetyFileSerializer(safety_group).data)
class SafetyResponsebilityAPIView(APIView):
class SafetyAPIView(APIView):
def get(self, request):
fireuser = OrderResponsibility.objects.get(id=54)
responsobility_users = OrderResponsibilitySerializer(fireuser)
return Response(responsobility_users.data)
chapters = self.request.query_params.get('chapter', "fire")
safety_group = SafetyType.objects.get(path=chapters)
# print(safety_group)
return Response(SafetySerializer(safety_group).data)
# return Response("d")
class CommitteeFilesAPIView(APIView):
# class SafetyResponsebilityAPIView(APIView):
# def get(self, request):
# fireuser = OrderResponsibility.objects.get(id=54)
# responsobility_users = OrderResponsibilitySerializer(fireuser)
def get(self, request):
# return Response(responsobility_users.data)
# class CommitteeFilesAPIView(APIView):
committee_files = Committee1.objects.get(id=106)
files = Committee1Serializer(committee_files)
# def get(self, request):
return Response(files.data)
# committee_files = Committee1.objects.get(id=106)
# files = Committee1Serializer(committee_files)
# return Response(files.data)