Добавлены сериализаторы и произведена небольшая коррекция моделей модуля тестов

This commit is contained in:
Andrei Filippov committed 2024-09-10 10:15:13 +03:00
1 parent 52ac220377
commit 9adcfb26bc
5 files changed
+78 -13

No files matched your search

+11 -1
View File
@@ -1,3 +1,13 @@
from django.shortcuts import render
from rest_framework.views import APIView
from rest_framework.response import Response
from .models import *
from .serializers import *
# Create your views here.
class GetAllTests(APIView):
def get(request,self):
all_tests = Test.objects.all()
return Response(TestSerializer(all_tests, many=True).data )