2023-04-22 11:00:04 +08:00
|
|
|
from django.shortcuts import render
|
|
|
|
|
|
|
|
# Create your views here.
|
|
|
|
from rest_framework.permissions import IsAuthenticated
|
|
|
|
from rest_framework import viewsets
|
2023-04-22 11:59:16 +08:00
|
|
|
from .serializers import ScheduleSerializer, StudentScheduleSerializer
|
|
|
|
from .models import Schedule, StudentSchedule
|
2023-04-22 11:00:04 +08:00
|
|
|
|
|
|
|
|
|
|
|
class ScheduleViewSet(viewsets.ModelViewSet):
|
|
|
|
# permission_classes = [IsAuthenticated]
|
|
|
|
serializer_class = ScheduleSerializer
|
|
|
|
queryset = Schedule.objects.all()
|
2023-04-22 11:59:16 +08:00
|
|
|
|
|
|
|
|
|
|
|
class StudentScheduleViewSet(viewsets.ModelViewSet):
|
|
|
|
# permission_classes = [IsAuthenticated]
|
|
|
|
serializer_class = StudentScheduleSerializer
|
|
|
|
queryset = StudentSchedule.objects.all()
|