Files
PORTAL_COD2/general_vacation/views.py
T
2023-09-27 09:14:15 +03:00

18 lines
698 B
Python

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})