Mikhaelle/Trabalho-Individual-2020-2

View on GitHub
api/task/views.py

Summary

Maintainability
A
0 mins
Test Coverage
from django.shortcuts import render
from .models import Task
from rest_framework import generics
from .serializers import TaskSerializer


class TaskCreate(generics.CreateAPIView):
    queryset = Task.objects.all(),
    serializer_class = TaskSerializer


class TaskList(generics.ListAPIView):
    queryset = Task.objects.all()
    serializer_class = TaskSerializer

class TaskDetail(generics.RetrieveAPIView):
    queryset = Task.objects.all()
    serializer_class = TaskSerializer

class TaskUpdate(generics.RetrieveUpdateAPIView):
    queryset = Task.objects.all()
    serializer_class = TaskSerializer

class TaskDelete(generics.RetrieveDestroyAPIView):
    queryset = Task.objects.all()
    serializer_class = TaskSerializer