from rest_framework import permissions, viewsets

from tasks.api import serializers
from tasks import models


class TaskViewSet(viewsets.ModelViewSet):
    queryset = models.Task.objects.all().order_by("-created")
    serializer_class = serializers.TaskSerializer
    permission_classes = [permissions.IsAuthenticated]
