Django backend for WorkX project
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
Ce dépôt est archivé. Vous pouvez voir les fichiers et le cloner, mais vous ne pouvez pas pousser ni ouvrir de ticket/demande d'ajout.

14 lignes
503 B

  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]