From ccb2b8ff691760e4e93f3905975b285cee8b67f8 Mon Sep 17 00:00:00 2001 From: Xavier Ordoquy Date: Tue, 10 Feb 2015 23:56:05 +0100 Subject: Update documentation --- api-guide/viewsets/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'api-guide/viewsets/index.html') diff --git a/api-guide/viewsets/index.html b/api-guide/viewsets/index.html index 13debab3..7029dc8d 100644 --- a/api-guide/viewsets/index.html +++ b/api-guide/viewsets/index.html @@ -587,7 +587,7 @@ class UserViewSet(viewsets.ModelViewSet): def get_queryset(self): return self.request.user.accounts.all() -

Note however that upon removal of the queryset property from your ViewSet, any associated router will be unable to derive the base_name of your Model automatically, and so you you will have to specify the base_name kwarg as part of your router registration.

+

Note however that upon removal of the queryset property from your ViewSet, any associated router will be unable to derive the base_name of your Model automatically, and so you will have to specify the base_name kwarg as part of your router registration.

Also note that although this class provides the complete set of create/list/retrieve/update/destroy actions by default, you can restrict the available operations by using the standard permission classes.

ReadOnlyModelViewSet

The ReadOnlyModelViewSet class also inherits from GenericAPIView. As with ModelViewSet it also includes implementations for various actions, but unlike ModelViewSet only provides the 'read-only' actions, .list() and .retrieve().

-- cgit v1.2.3