You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
12 lines
496 B
12 lines
496 B
from rest_framework import generics
|
|
from .serializers import SessionSerializer
|
|
from .models import Session
|
|
|
|
class SessionList(generics.ListCreateAPIView):
|
|
queryset = Session.objects.all().order_by('-id') # tell django how to retrieve all objects from the DB
|
|
serializer_class = SessionSerializer # tell django what serializer to use
|
|
|
|
class SessionDetail(generics.RetrieveUpdateDestroyAPIView):
|
|
queryset = Session.objects.all().order_by('-id')
|
|
serializer_class = SessionSerializer
|