
from rest_framework import permissions, viewsets

from trails.api import serializers
from trails import models


class TrailViewSet(viewsets.ModelViewSet):
    queryset = models.Trail.objects.all().order_by("-created")
    serializer_class = serializers.TrailSerializer
    permission_classes = [permissions.IsAuthenticated]
