aboutsummaryrefslogtreecommitdiffstats
path: root/api-guide/viewsets/index.html
diff options
context:
space:
mode:
Diffstat (limited to 'api-guide/viewsets/index.html')
-rw-r--r--api-guide/viewsets/index.html1
1 files changed, 1 insertions, 0 deletions
diff --git a/api-guide/viewsets/index.html b/api-guide/viewsets/index.html
index c293a4c2..85dbe299 100644
--- a/api-guide/viewsets/index.html
+++ b/api-guide/viewsets/index.html
@@ -579,6 +579,7 @@ class UserViewSet(viewsets.ModelViewSet):
def get_queryset(self):
return self.request.user.accounts.all()
</code></pre>
+<p>Note however that upon removal of the <code>queryset</code> property from your <code>ViewSet</code>, any associated <a href="../routers">router</a> will be unable to derive the base_name of your Model automatically, and so you you will have to specify the <code>base_name</code> kwarg as part of your <a href="../routers">router registration</a>.</p>
<p>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.</p>
<h2 id="readonlymodelviewset">ReadOnlyModelViewSet</h2>
<p>The <code>ReadOnlyModelViewSet</code> class also inherits from <code>GenericAPIView</code>. As with <code>ModelViewSet</code> it also includes implementations for various actions, but unlike <code>ModelViewSet</code> only provides the 'read-only' actions, <code>.list()</code> and <code>.retrieve()</code>.</p>