Django backend for WorkX project
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
此仓库已存档。您可以查看文件和克隆,但不能推送或创建工单/合并请求。

12345678910111213
  1. from rest_framework import viewsets
  2. from rest_framework.authentication import TokenAuthentication, SessionAuthentication
  3. from rest_framework.permissions import IsAuthenticated
  4. from .models import Employee
  5. from .serializers import EmployeeSerializer
  6. class EmployeeViewSet(viewsets.ReadOnlyModelViewSet):
  7. queryset = Employee.objects.all()
  8. serializer_class = EmployeeSerializer
  9. authentication_classes = [TokenAuthentication, SessionAuthentication]
  10. permission_classes = [IsAuthenticated]