Updated rest framework to 3.9

This commit is contained in:
Eliot Berriot 2019-01-11 13:33:35 +01:00
parent 4a6df06360
commit 14392ebb0c
No known key found for this signature in database
GPG key ID: DD6965E2476E5C27
14 changed files with 187 additions and 116 deletions

View file

@ -1,9 +1,9 @@
from rest_framework import response
from rest_framework.decorators import list_route
from rest_framework import decorators
def action_route(serializer_class):
@list_route(methods=["post"])
@decorators.action(methods=["post"], detail=False)
def action(self, request, *args, **kwargs):
queryset = self.get_queryset()
serializer = serializer_class(request.data, queryset=queryset)