views.py 665 Bytes
Newer Older
alexandre's avatar
alexandre committed
1
from django.views.generic.list import ListView
alexandre's avatar
alexandre committed
2 3
from django.views.generic.base import TemplateView
from rest_framework import viewsets
4 5
from .models import Score
from .serializers import ScoreSerializer
alexandre's avatar
alexandre committed
6 7 8 9 10 11 12 13 14 15


class ScoreViewSet(viewsets.ModelViewSet):
    """
    API endpoint that allows users to be viewed or edited.
    """
    queryset = Score.objects.all()
    serializer_class = ScoreSerializer


alexandre's avatar
alexandre committed
16 17 18 19 20 21
class ScoreListView(ListView):
    """
    """
    model = Score


alexandre's avatar
alexandre committed
22
class ScoreDetailView(TemplateView):
alexandre's avatar
alexandre committed
23 24
    """
    """
alexandre's avatar
alexandre committed
25
    template_name = "playground/score_detail.html"
alexandre's avatar
alexandre committed
26 27


alexandre's avatar
alexandre committed
28 29 30 31
class SandboxView(TemplateView):
    """
    """
    template_name = "playground/sandbox.html"