from rest_framework import permissions, viewsets
from birds.api import serializers
from birds import models


class BirdViewSet(viewsets.ModelViewSet):
    queryset = models.Bird.objects.all().order_by("-created")
    serializer_class = serializers.BirdSerializer
    permission_classes = [permissions.IsAuthenticated]


class BirdingLocationViewSet(viewsets.ModelViewSet):
    queryset = models.BirdingLocation.objects.all().order_by("-created")
    serializer_class = serializers.BirdingLocationSerializer
    permission_classes = [permissions.IsAuthenticated]
