from rest_framework import permissions, viewsets

from puzzles.api import serializers
from puzzles import models

class PuzzleManufacturerViewSet(viewsets.ModelViewSet):
    queryset = models.PuzzleManufacturer.objects.all().order_by("-created")
    serializer_class = serializers.PuzzleManufacturerSerializer
    permission_classes = [permissions.IsAuthenticated]


class PuzzleViewSet(viewsets.ModelViewSet):
    queryset = models.Puzzle.objects.all().order_by("-created")
    serializer_class = serializers.PuzzleSerializer
    permission_classes = [permissions.IsAuthenticated]
