This commit is contained in:
David Sanders 2016-09-30 14:07:05 +00:00 committed by GitHub
commit 7822c425bb

View File

@ -45,7 +45,7 @@ class ExampleViewSet(ModelViewSet):
def custom_action(self, request, pk):
return super(ExampleSerializer, self).retrieve(self, request)
@list_route()
@list_route(methods=['get', 'post'])
def custom_list_action(self, request):
return super(ExampleViewSet, self).list(self, request)
@ -99,6 +99,10 @@ class TestRouterGeneratedSchema(TestCase):
url='/example/custom_list_action/',
action='get'
),
'custom_list_action': coreapi.Link(
url='/example/custom_list_action/',
action='post'
),
'retrieve': coreapi.Link(
url='/example/{pk}/',
action='get',