<filename>apps/api_v1/matches/viewsets.py<gh_stars>1-10
"""views"""
from rest_framework import viewsets
from rest_framework.permissions import IsAuthenticatedOrReadOnly

from matches.models import Match
from .serializers import MatchSerializer


class MatchViewSet(viewsets.ReadOnlyModelViewSet):
    """Retrieve match list or detail"""
    queryset = Match.objects.all().order_by("date")
    serializer_class = MatchSerializer
    lookup_field = "uuid"
    permission_classes = [IsAuthenticatedOrReadOnly]

<filename>apps/api_v1/matches/viewsets.py<gh_stars>1-10
"""views"""
from rest_framework import viewsets
from rest_framework.permissions import IsAuthenticatedOrReadOnly

from matches.models import Match
from .serializers import MatchSerializer


class MatchViewSet(viewsets.ReadOnlyModelViewSet):
    """Retrieve match list or detail"""
    queryset = Match.objects.all().order_by("date")
    serializer_class = MatchSerializer
    lookup_field = "uuid"
    permission_classes = [IsAuthenticatedOrReadOnly]

views Retrieve match list or detail