P-28-feat:create display card img/pdf with download

This commit is contained in:
Alex committed 2024-05-20 14:28:56 +03:00
1 parent 58372282fb
commit 60e8c08ba4
3 files changed
+51 -63

No files matched your search

-5
View File
@@ -12,19 +12,14 @@ from userauth.models import *
class SafetyTypeAPIView(ListAPIView):
def get(self, request):
print("sdfsdssssssssssssssssssssssssss")
chapters = SafetyType.objects.annotate(Count("mainpage_file")).filter(mainpage_file__count__gt=0)
return Response(SafetyTypeSerializer(chapters, many=True).data)
class SafetyAPIView(APIView):
def get(self, request):
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 SafetyResponsebilityAPIView(APIView):