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


class BeerViewSet(viewsets.ModelViewSet):
    queryset = models.Beer.objects.all().order_by("-created")
    serializer_class = serializers.BeerSerializer
    permission_classes = [permissions.IsAuthenticated]


class BeerProducerViewSet(viewsets.ModelViewSet):
    queryset = models.BeerProducer.objects.all().order_by("-created")
    serializer_class = serializers.BeerProducerSerializer
    permission_classes = [permissions.IsAuthenticated]


class BeerStyleViewSet(viewsets.ModelViewSet):
    queryset = models.BeerStyle.objects.all().order_by("-created")
    serializer_class = serializers.BeerStyleSerializer
    permission_classes = [permissions.IsAuthenticated]


class WineViewSet(viewsets.ModelViewSet):
    queryset = models.Wine.objects.all().order_by("-created")
    serializer_class = serializers.WineSerializer
    permission_classes = [permissions.IsAuthenticated]


class WineProducerViewSet(viewsets.ModelViewSet):
    queryset = models.WineProducer.objects.all().order_by("-created")
    serializer_class = serializers.WineProducerSerializer
    permission_classes = [permissions.IsAuthenticated]


class WineRegionViewSet(viewsets.ModelViewSet):
    queryset = models.WineRegion.objects.all().order_by("-created")
    serializer_class = serializers.WineRegionSerializer
    permission_classes = [permissions.IsAuthenticated]


class WineGrapeViewSet(viewsets.ModelViewSet):
    queryset = models.WineGrape.objects.all().order_by("-created")
    serializer_class = serializers.WineGrapeSerializer
    permission_classes = [permissions.IsAuthenticated]


class CoffeeViewSet(viewsets.ModelViewSet):
    queryset = models.Coffee.objects.all().order_by("-created")
    serializer_class = serializers.CoffeeSerializer
    permission_classes = [permissions.IsAuthenticated]


class CoffeeRoasterViewSet(viewsets.ModelViewSet):
    queryset = models.CoffeeRoaster.objects.all().order_by("-created")
    serializer_class = serializers.CoffeeRoasterSerializer
    permission_classes = [permissions.IsAuthenticated]


class DrinkViewSet(viewsets.ModelViewSet):
    queryset = models.Drink.objects.all().order_by("-created")
    serializer_class = serializers.DrinkSerializer
    permission_classes = [permissions.IsAuthenticated]
