Created
September 26, 2017 12:09
-
-
Save elcolie/34fa66632209f14624899d997919d3fb to your computer and use it in GitHub Desktop.
viewsets.py
This file contains 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 import status | |
from rest_framework.response import Response | |
from rest_framework.viewsets import ModelViewSet | |
from soken_web.apps.uploaded_files.api.serializers import CustomerFromExcelSerializer | |
from soken_web.apps.uploaded_files.models import CustomerFromExcel | |
class CustomerFromExcelViewset(ModelViewSet): | |
queryset = CustomerFromExcel.objects.all() | |
serializer_class = CustomerFromExcelSerializer | |
def update(self, request, *args, **kwargs): | |
return Response({"message": "Method UPDATE not allowed"}, status=status.HTTP_405_METHOD_NOT_ALLOWED) | |
def partial_update(self, request, *args, **kwargs): | |
return Response({"message": "Method PATCH not allowed"}, status=status.HTTP_405_METHOD_NOT_ALLOWED) | |
def destroy(self, request, *args, **kwargs): | |
return Response({"message": "Method DELETE not allowed"}, status=status.HTTP_405_METHOD_NOT_ALLOWED) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment