18 lines
698 B
Python
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})
|