diff options
Diffstat (limited to 'api-guide/viewsets.html')
| -rw-r--r-- | api-guide/viewsets.html | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/api-guide/viewsets.html b/api-guide/viewsets.html index a9952205..0b3293e3 100644 --- a/api-guide/viewsets.html +++ b/api-guide/viewsets.html @@ -102,6 +102,7 @@ <li><a href="http://django-rest-framework.org/topics/browser-enhancements">Browser enhancements</a></li> <li><a href="http://django-rest-framework.org/topics/browsable-api">The Browsable API</a></li> <li><a href="http://django-rest-framework.org/topics/rest-hypermedia-hateoas">REST, Hypermedia & HATEOAS</a></li> + <li><a href="http://django-rest-framework.org/topics/contributing">Contributing to REST framework</a></li> <li><a href="http://django-rest-framework.org/topics/rest-framework-2-announcement">2.0 Announcement</a></li> <li><a href="http://django-rest-framework.org/topics/2.2-announcement">2.2 Announcement</a></li> <li><a href="http://django-rest-framework.org/topics/2.3-announcement">2.3 Announcement</a></li> @@ -347,7 +348,7 @@ class UserViewSet(viewsets.ModelViewSet): <p>The <code>ModelViewSet</code> class inherits from <code>GenericAPIView</code> and includes implementations for various actions, by mixing in the behavior of the various mixin classes.</p> <p>The actions provided by the <code>ModelViewSet</code> class are <code>.list()</code>, <code>.retrieve()</code>, <code>.create()</code>, <code>.update()</code>, and <code>.destroy()</code>.</p> <h4 id="example_1">Example</h4> -<p>Because <code>ModelViewSet</code> extends <code>GenericAPIView</code>, you'll normally need to provide at least the <code>queryset</code> and <code>serializer_class</code> attributes. For example:</p> +<p>Because <code>ModelViewSet</code> extends <code>GenericAPIView</code>, you'll normally need to provide at least the <code>queryset</code> and <code>serializer_class</code> attributes, or the <code>model</code> attribute shortcut. For example:</p> <pre class="prettyprint lang-py"><code>class AccountViewSet(viewsets.ModelViewSet): """ A simple ViewSet for viewing and editing accounts. |
