Попытка 3

This commit is contained in:
iriska-gri committed 2023-09-27 09:14:15 +03:00
1 parent 7cba2e0366
commit 1b3ac28ddf
15 files changed

No files matched your search

+17
View File
@@ -0,0 +1,17 @@
from rest_framework.response import Response
import datetime
from .serializers import *
from .models import *
from rest_framework.views import APIView
class GeneralVacationAPIView(APIView):
def get(self, request):
general = GeneralVacation.objects.all()
# Сериализуем извлечённый набор записей
serializer_for_basecrit = GeneralVacationSerializer(
instance=general, # Передаём набор записей
many=True # Указываем, что на вход подаётся именно набор записей
)
return Response({"Отпуск": serializer_for_basecrit.data})