diff options
| author | Tom Christie | 2014-12-08 15:16:45 +0000 |
|---|---|---|
| committer | Tom Christie | 2014-12-08 15:16:45 +0000 |
| commit | 61eb64ed2424bbff8879311121c9a5dfe21f721d (patch) | |
| tree | 548b2bdb9a9de1a4fbe01b7c8d9a20ea9507c066 /api-guide/viewsets | |
| parent | 78f5bcb5cbc9cbed6c335734e81714bc2daa294a (diff) | |
| download | django-rest-framework-61eb64ed2424bbff8879311121c9a5dfe21f721d.tar.bz2 | |
Update documentation
Diffstat (limited to 'api-guide/viewsets')
| -rw-r--r-- | api-guide/viewsets/index.html | 1 |
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> |
