2022-08-20 03:33:23 +00:00
|
|
|
from typing import Any
|
2022-08-19 10:35:05 +00:00
|
|
|
from rest_framework.response import Response
|
|
|
|
from rest_framework.views import APIView
|
2022-08-20 03:33:23 +00:00
|
|
|
from rest_framework import mixins
|
|
|
|
from rest_framework.request import Request
|
|
|
|
from rest_framework.viewsets import GenericViewSet
|
2022-08-19 10:35:05 +00:00
|
|
|
|
2022-08-20 03:33:23 +00:00
|
|
|
from frog_api.models import Entry, Project
|
|
|
|
from frog_api.serializers import EntrySerializer, ProjectSerializer
|
2022-08-19 10:35:05 +00:00
|
|
|
|
|
|
|
|
|
|
|
class ProjectView(APIView):
|
|
|
|
"""
|
|
|
|
API endpoint that allows projects to be viewed or edited.
|
|
|
|
"""
|
|
|
|
|
|
|
|
def get(self, request, format=None):
|
|
|
|
"""
|
|
|
|
Return a list of all projects.
|
|
|
|
"""
|
|
|
|
projects = Project.objects.all()
|
|
|
|
serializer = ProjectSerializer(projects, many=True)
|
|
|
|
return Response(serializer.data)
|