diff options
Diffstat (limited to 'api-guide')
| -rw-r--r-- | api-guide/authentication.html | 1 | ||||
| -rw-r--r-- | api-guide/content-negotiation.html | 1 | ||||
| -rw-r--r-- | api-guide/exceptions.html | 1 | ||||
| -rw-r--r-- | api-guide/fields.html | 5 | ||||
| -rw-r--r-- | api-guide/filtering.html | 1 | ||||
| -rw-r--r-- | api-guide/format-suffixes.html | 1 | ||||
| -rw-r--r-- | api-guide/generic-views.html | 5 | ||||
| -rw-r--r-- | api-guide/pagination.html | 1 | ||||
| -rw-r--r-- | api-guide/parsers.html | 1 | ||||
| -rw-r--r-- | api-guide/permissions.html | 1 | ||||
| -rw-r--r-- | api-guide/relations.html | 1 | ||||
| -rw-r--r-- | api-guide/renderers.html | 5 | ||||
| -rw-r--r-- | api-guide/requests.html | 1 | ||||
| -rw-r--r-- | api-guide/responses.html | 1 | ||||
| -rw-r--r-- | api-guide/reverse.html | 1 | ||||
| -rw-r--r-- | api-guide/routers.html | 1 | ||||
| -rw-r--r-- | api-guide/serializers.html | 1 | ||||
| -rw-r--r-- | api-guide/settings.html | 1 | ||||
| -rw-r--r-- | api-guide/status-codes.html | 1 | ||||
| -rw-r--r-- | api-guide/testing.html | 1 | ||||
| -rw-r--r-- | api-guide/throttling.html | 1 | ||||
| -rw-r--r-- | api-guide/views.html | 1 | ||||
| -rw-r--r-- | api-guide/viewsets.html | 3 |
23 files changed, 31 insertions, 6 deletions
diff --git a/api-guide/authentication.html b/api-guide/authentication.html index 63c2f3f0..8bbed7c0 100644 --- a/api-guide/authentication.html +++ b/api-guide/authentication.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> diff --git a/api-guide/content-negotiation.html b/api-guide/content-negotiation.html index c21a6430..147e11e6 100644 --- a/api-guide/content-negotiation.html +++ b/api-guide/content-negotiation.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> diff --git a/api-guide/exceptions.html b/api-guide/exceptions.html index 16dc8752..9887d767 100644 --- a/api-guide/exceptions.html +++ b/api-guide/exceptions.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> diff --git a/api-guide/fields.html b/api-guide/fields.html index dae3cc69..00c65b1c 100644 --- a/api-guide/fields.html +++ b/api-guide/fields.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> @@ -247,7 +248,7 @@ Set to false if this field is not required to be present during deserialization.</p> <p>Defaults to <code>True</code>.</p> <h3 id="default"><code>default</code></h3> -<p>If set, this gives the default value that will be used for the field if none is supplied. If not set the default behavior is to not populate the attribute at all. </p> +<p>If set, this gives the default value that will be used for the field if no input value is supplied. If not set the default behavior is to not populate the attribute at all. </p> <p>May be set to a function or other callable, in which case the value will be evaluated each time it is used.</p> <h3 id="validators"><code>validators</code></h3> <p>A list of Django validators that should be used to validate deserialized values.</p> @@ -407,7 +408,7 @@ or <code>django.db.models.fields.TextField</code>.</p> <h2 id="imagefield">ImageField</h2> <p>An image representation.</p> <p>Corresponds to <code>django.forms.fields.ImageField</code>.</p> -<p>Requires the <code>PIL</code> package.</p> +<p>Requires either the <code>Pillow</code> package or <code>PIL</code> package. The <code>Pillow</code> package is recommended, as <code>PIL</code> is no longer actively maintained.</p> <p>Signature and validation is the same as with <code>FileField</code>.</p> <hr /> <p><strong>Note:</strong> <code>FileFields</code> and <code>ImageFields</code> are only suitable for use with MultiPartParser, since e.g. json doesn't support file uploads. diff --git a/api-guide/filtering.html b/api-guide/filtering.html index 28dae4e8..6cfa40a3 100644 --- a/api-guide/filtering.html +++ b/api-guide/filtering.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> diff --git a/api-guide/format-suffixes.html b/api-guide/format-suffixes.html index 38557daf..1c1f9a4c 100644 --- a/api-guide/format-suffixes.html +++ b/api-guide/format-suffixes.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> diff --git a/api-guide/generic-views.html b/api-guide/generic-views.html index e1ef2ea9..2828fa42 100644 --- a/api-guide/generic-views.html +++ b/api-guide/generic-views.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> @@ -346,11 +347,13 @@ class UserList(generics.ListCreateAPIView): return 20 return 100 </code></pre> -<p><strong>Save hooks</strong>:</p> +<p><strong>Save / deletion hooks</strong>:</p> <p>The following methods are provided as placeholder interfaces. They contain empty implementations and are not called directly by <code>GenericAPIView</code>, but they are overridden and used by some of the mixin classes.</p> <ul> <li><code>pre_save(self, obj)</code> - A hook that is called before saving an object.</li> <li><code>post_save(self, obj, created=False)</code> - A hook that is called after saving an object.</li> +<li><code>pre_delete(self, obj)</code> - A hook that is called before deleting an object.</li> +<li><code>post_delete(self, obj)</code> - A hook that is called after deleting an object.</li> </ul> <p>The <code>pre_save</code> method in particular is a useful hook for setting attributes that are implicit in the request, but are not part of the request data. For instance, you might set an attribute on the object based on the request user, or based on a URL keyword argument.</p> <pre class="prettyprint lang-py"><code>def pre_save(self, obj): diff --git a/api-guide/pagination.html b/api-guide/pagination.html index 395a94ec..d3a268fb 100644 --- a/api-guide/pagination.html +++ b/api-guide/pagination.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> diff --git a/api-guide/parsers.html b/api-guide/parsers.html index 5a4fcd7c..a7a87898 100644 --- a/api-guide/parsers.html +++ b/api-guide/parsers.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> diff --git a/api-guide/permissions.html b/api-guide/permissions.html index 7153f0c2..8ad8f8c6 100644 --- a/api-guide/permissions.html +++ b/api-guide/permissions.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> diff --git a/api-guide/relations.html b/api-guide/relations.html index d4bdc393..34252036 100644 --- a/api-guide/relations.html +++ b/api-guide/relations.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> diff --git a/api-guide/renderers.html b/api-guide/renderers.html index 11b0e161..cb723e6a 100644 --- a/api-guide/renderers.html +++ b/api-guide/renderers.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> @@ -338,14 +339,14 @@ Unlike other renderers, the data passed to the <code>Response</code> does not ne <li>The return result of calling <code>view.get_template_names()</code>.</li> </ol> <p>An example of a view that uses <code>TemplateHTMLRenderer</code>:</p> -<pre class="prettyprint lang-py"><code>class UserDetail(generics.RetrieveUserAPIView): +<pre class="prettyprint lang-py"><code>class UserDetail(generics.RetrieveAPIView): """ A view that returns a templated HTML representations of a given user. """ queryset = User.objects.all() renderer_classes = (TemplateHTMLRenderer,) - def get(self, request, *args, **kwargs) + def get(self, request, *args, **kwargs): self.object = self.get_object() return Response({'user': self.object}, template_name='user_detail.html') </code></pre> diff --git a/api-guide/requests.html b/api-guide/requests.html index ee15a0a8..9a496e30 100644 --- a/api-guide/requests.html +++ b/api-guide/requests.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> diff --git a/api-guide/responses.html b/api-guide/responses.html index 9c470740..b1473037 100644 --- a/api-guide/responses.html +++ b/api-guide/responses.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> diff --git a/api-guide/reverse.html b/api-guide/reverse.html index 172ef1e8..d6af0887 100644 --- a/api-guide/reverse.html +++ b/api-guide/reverse.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> diff --git a/api-guide/routers.html b/api-guide/routers.html index e3d212da..0bc72e5f 100644 --- a/api-guide/routers.html +++ b/api-guide/routers.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> diff --git a/api-guide/serializers.html b/api-guide/serializers.html index 39ca749c..c7baee14 100644 --- a/api-guide/serializers.html +++ b/api-guide/serializers.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> diff --git a/api-guide/settings.html b/api-guide/settings.html index 0ab1f675..f265863c 100644 --- a/api-guide/settings.html +++ b/api-guide/settings.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> diff --git a/api-guide/status-codes.html b/api-guide/status-codes.html index c6a3dea8..906b2f9e 100644 --- a/api-guide/status-codes.html +++ b/api-guide/status-codes.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> diff --git a/api-guide/testing.html b/api-guide/testing.html index 7f90df04..df09659e 100644 --- a/api-guide/testing.html +++ b/api-guide/testing.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> diff --git a/api-guide/throttling.html b/api-guide/throttling.html index 7f8539f0..cb633916 100644 --- a/api-guide/throttling.html +++ b/api-guide/throttling.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> diff --git a/api-guide/views.html b/api-guide/views.html index 21c4ce4e..c8338560 100644 --- a/api-guide/views.html +++ b/api-guide/views.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> 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. |
