This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from rest_framework.views import APIView | |
| from curd.serializers import StudentSerializers | |
| from curd.models import Student | |
| from rest_framework import status, permissions | |
| from rest_framework.response import Response | |
| from django.shortcuts import get_object_or_404 | |
| class StudentCurd(APIView): | |
| permission_classes = [permissions.AllowAny] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from rest_framework.views import APIView | |
| from curd.serializers import StudentSerializers | |
| from curd.models import Student | |
| from rest_framework import status, permissions, generics | |
| from rest_framework.response import Response | |
| from django.shortcuts import get_object_or_404 | |
| class StudentCurd(generics.ListCreateAPIView): | |
| queryset = Student.objects.all() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from rest_framework.views import APIView | |
| from curd.serializers import StudentSerializers | |
| from curd.models import Student | |
| from rest_framework import status, permissions, generics, viewsets | |
| from rest_framework.response import Response | |
| from django.shortcuts import get_object_or_404 | |
| class StudentCurd(viewsets.ViewSetMixin, generics.ListCreateAPIView, generics.RetrieveUpdateDestroyAPIView): | |
| queryset = Student.objects.all() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from rest_framework.views import APIView | |
| from curd.serializers import StudentSerializers | |
| from curd.models import Student | |
| from rest_framework import status, permissions, generics, viewsets | |
| from rest_framework.response import Response | |
| from django.shortcuts import get_object_or_404 | |
| class StudentCurd(viewsets.ViewSet): | |
| permission_classes = [permissions.AllowAny] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from rest_framework.views import APIView | |
| from curd.serializers import StudentSerializers | |
| from curd.models import Student | |
| from rest_framework import status, permissions, generics, viewsets | |
| from rest_framework.response import Response | |
| from django.shortcuts import get_object_or_404 | |
| class StudentCurd(viewsets.ModelViewSet): | |
| queryset = Student.objects.all() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class View: | |
| """ | |
| Intentionally simple parent class for all views. Only implements | |
| dispatch-by-method and simple sanity checking. | |
| """ | |
| http_method_names = ['get', 'post', 'put', 'patch', 'delete', 'head', 'options', 'trace'] | |
| class APIView(View): |
OlderNewer