Update documentation

This commit is contained in:
Tom Christie 2015-09-11 12:06:48 +00:00
parent 5cbb535d11
commit 0fa5a8e012
13 changed files with 123 additions and 88 deletions

BIN
.DS_Store vendored

Binary file not shown.

View File

@ -583,7 +583,7 @@ Set to false if this field is not required to be present during deserialization.
<p>Defaults to <code>False</code></p> <p>Defaults to <code>False</code></p>
<h3 id="default"><code>default</code></h3> <h3 id="default"><code>default</code></h3>
<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>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> <p>May be set to a function or other callable, in which case the value will be evaluated each time it is used. When called, it will receive no arguments. If the callable has a <code>set_context</code> method, that will be called each time before getting the value with the field instance as only argument. This works the same way as for <a href="../validators/#using-set_context">validators</a>.</p>
<p>Note that setting a <code>default</code> value implies that the field is not required. Including both the <code>default</code> and <code>required</code> keyword arguments is invalid and will raise an error.</p> <p>Note that setting a <code>default</code> value implies that the field is not required. Including both the <code>default</code> and <code>required</code> keyword arguments is invalid and will raise an error.</p>
<h3 id="source"><code>source</code></h3> <h3 id="source"><code>source</code></h3>
<p>The name of the attribute that will be used to populate the field. May be a method that only takes a <code>self</code> argument, such as <code>URLField('get_absolute_url')</code>, or may use dotted notation to traverse attributes, such as <code>EmailField(source='user.email')</code>.</p> <p>The name of the attribute that will be used to populate the field. May be a method that only takes a <code>self</code> argument, such as <code>URLField('get_absolute_url')</code>, or may use dotted notation to traverse attributes, such as <code>EmailField(source='user.email')</code>.</p>

View File

@ -413,6 +413,10 @@
<a href="#django-rest-framework-full-word-search-filter">Django REST framework full word search filter</a> <a href="#django-rest-framework-full-word-search-filter">Django REST framework full word search filter</a>
</li> </li>
<li>
<a href="#django-url-filter">Django URL Filter</a>
</li>
@ -688,7 +692,6 @@ class ProductFilter(django_filters.FilterSet):
<hr /> <hr />
<h2 id="djangoobjectpermissionsfilter">DjangoObjectPermissionsFilter</h2> <h2 id="djangoobjectpermissionsfilter">DjangoObjectPermissionsFilter</h2>
<p>The <code>DjangoObjectPermissionsFilter</code> is intended to be used together with the <a href="https://django-guardian.readthedocs.org/"><code>django-guardian</code></a> package, with custom <code>'view'</code> permissions added. The filter will ensure that querysets only returns objects for which the user has the appropriate view permission.</p> <p>The <code>DjangoObjectPermissionsFilter</code> is intended to be used together with the <a href="https://django-guardian.readthedocs.org/"><code>django-guardian</code></a> package, with custom <code>'view'</code> permissions added. The filter will ensure that querysets only returns objects for which the user has the appropriate view permission.</p>
<p>This filter class must be used with views that provide either a <code>queryset</code> or a <code>model</code> attribute.</p>
<p>If you're using <code>DjangoObjectPermissionsFilter</code>, you'll probably also want to add an appropriate object permissions class, to ensure that users can only operate on instances if they have the appropriate object permissions. The easiest way to do this is to subclass <code>DjangoObjectPermissions</code> and add <code>'view'</code> permissions to the <code>perms_map</code> attribute.</p> <p>If you're using <code>DjangoObjectPermissionsFilter</code>, you'll probably also want to add an appropriate object permissions class, to ensure that users can only operate on instances if they have the appropriate object permissions. The easiest way to do this is to subclass <code>DjangoObjectPermissions</code> and add <code>'view'</code> permissions to the <code>perms_map</code> attribute.</p>
<p>A complete example using both <code>DjangoObjectPermissionsFilter</code> and <code>DjangoObjectPermissions</code> might look something like this.</p> <p>A complete example using both <code>DjangoObjectPermissionsFilter</code> and <code>DjangoObjectPermissions</code> might look something like this.</p>
<p><strong>permissions.py</strong>:</p> <p><strong>permissions.py</strong>:</p>
@ -740,6 +743,8 @@ class ProductFilter(django_filters.FilterSet):
<p>The <a href="https://github.com/philipn/django-rest-framework-filters">django-rest-framework-filters package</a> works together with the <code>DjangoFilterBackend</code> class, and allows you to easily create filters across relationships, or create multiple filter lookup types for a given field.</p> <p>The <a href="https://github.com/philipn/django-rest-framework-filters">django-rest-framework-filters package</a> works together with the <code>DjangoFilterBackend</code> class, and allows you to easily create filters across relationships, or create multiple filter lookup types for a given field.</p>
<h2 id="django-rest-framework-full-word-search-filter">Django REST framework full word search filter</h2> <h2 id="django-rest-framework-full-word-search-filter">Django REST framework full word search filter</h2>
<p>The <a href="https://github.com/trollknurr/django-rest-framework-word-search-filter">djangorestframework-word-filter</a> developed as alternative to <code>filters.SearchFilter</code> which will search full word in text, or exact match.</p> <p>The <a href="https://github.com/trollknurr/django-rest-framework-word-search-filter">djangorestframework-word-filter</a> developed as alternative to <code>filters.SearchFilter</code> which will search full word in text, or exact match.</p>
<h2 id="django-url-filter">Django URL Filter</h2>
<p><a href="https://github.com/miki725/django-url-filter">django-url-filter</a> provides a safe way to filter data via human-friendly URLs. It works very similar to DRF serializers and fields in a sense that they can be nested except they are called filtersets and filters. That provides easy way to filter related data. Also this library is generic-purpose so it can be used to filter other sources of data and not only Django <code>QuerySet</code>s.</p>
</div> <!--/span--> </div> <!--/span-->

View File

@ -431,7 +431,7 @@
<li>Pagination links that are included in response headers, such as <code>Content-Range</code> or <code>Link</code>.</li> <li>Pagination links that are included in response headers, such as <code>Content-Range</code> or <code>Link</code>.</li>
</ul> </ul>
<p>The built-in styles currently all use links included as part of the content of the response. This style is more accessible when using the browsable API.</p> <p>The built-in styles currently all use links included as part of the content of the response. This style is more accessible when using the browsable API.</p>
<p>Pagination is only performed automatically if you're using the generic views or viewsets. If you're using a regular <code>APIView</code>, you'll need to call into the pagination API yourself to ensure you return a paginated response. See the source code for the <code>mixins.ListMixin</code> and <code>generics.GenericAPIView</code> classes for an example.</p> <p>Pagination is only performed automatically if you're using the generic views or viewsets. If you're using a regular <code>APIView</code>, you'll need to call into the pagination API yourself to ensure you return a paginated response. See the source code for the <code>mixins.ListModelMixin</code> and <code>generics.GenericAPIView</code> classes for an example.</p>
<h2 id="setting-the-pagination-style">Setting the pagination style</h2> <h2 id="setting-the-pagination-style">Setting the pagination style</h2>
<p>The default pagination style may be set globally, using the <code>DEFAULT_PAGINATION_CLASS</code> settings key. For example, to use the built-in limit/offset pagination, you would do:</p> <p>The default pagination style may be set globally, using the <code>DEFAULT_PAGINATION_CLASS</code> settings key. For example, to use the built-in limit/offset pagination, you would do:</p>
<pre><code>REST_FRAMEWORK = { <pre><code>REST_FRAMEWORK = {

View File

@ -868,7 +868,7 @@ class CustomerHyperlink(serializers.HyperlinkedRelatedField):
tagged_object = GenericForeignKey('content_type', 'object_id') tagged_object = GenericForeignKey('content_type', 'object_id')
def __unicode__(self): def __unicode__(self):
return self.tag return self.tag_name
</code></pre> </code></pre>
<p>And the following two models, which may be have associated tags:</p> <p>And the following two models, which may be have associated tags:</p>
<pre><code>class Bookmark(models.Model): <pre><code>class Bookmark(models.Model):

View File

@ -497,6 +497,10 @@
</li> </li>
<li>
<a href="#django-rest-marshmallow">Django REST marshmallow</a>
</li>
<li> <li>
<a href="#mongoenginemodelserializer">MongoengineModelSerializer</a> <a href="#mongoenginemodelserializer">MongoengineModelSerializer</a>
</li> </li>
@ -677,6 +681,9 @@ class BlogPostSerializer(serializers.Serializer):
raise serializers.ValidationError("Blog post is not about Django") raise serializers.ValidationError("Blog post is not about Django")
return value return value
</code></pre> </code></pre>
<hr />
<p><strong>Note:</strong> If your <code>&lt;field_name&gt;</code> is declared on your serializer with the parameter <code>required=False</code> then this validation step will not take place if the field is not included.</p>
<hr />
<h4 id="object-level-validation">Object-level validation</h4> <h4 id="object-level-validation">Object-level validation</h4>
<p>To do any other validation that requires access to multiple fields, add a method called <code>.validate()</code> to your <code>Serializer</code> subclass. This method takes a single argument, which is a dictionary of field values. It should raise a <code>ValidationError</code> if necessary, or just return the validated values. For example:</p> <p>To do any other validation that requires access to multiple fields, add a method called <code>.validate()</code> to your <code>Serializer</code> subclass. This method takes a single argument, which is a dictionary of field values. It should raise a <code>ValidationError</code> if necessary, or just return the validated values. For example:</p>
<pre><code>from rest_framework import serializers <pre><code>from rest_framework import serializers
@ -1314,6 +1321,8 @@ def all_high_scores(request):
<hr /> <hr />
<h1 id="third-party-packages">Third party packages</h1> <h1 id="third-party-packages">Third party packages</h1>
<p>The following third party packages are also available.</p> <p>The following third party packages are also available.</p>
<h2 id="django-rest-marshmallow">Django REST marshmallow</h2>
<p>The <a href="http://tomchristie.github.io/django-rest-marshmallow/">django-rest-marshmallow</a> package provides an alternative implementation for serializers, using the python <a href="https://marshmallow.readthedocs.org/en/latest/">marshmallow</a> library. It exposes the same API as the REST framework serializers, and can be used as a drop-in replacement in some use-cases.</p>
<h2 id="mongoenginemodelserializer">MongoengineModelSerializer</h2> <h2 id="mongoenginemodelserializer">MongoengineModelSerializer</h2>
<p>The <a href="https://github.com/umutbozkurt/django-rest-framework-mongoengine">django-rest-framework-mongoengine</a> package provides a <code>MongoEngineModelSerializer</code> serializer class that supports using MongoDB as the storage layer for Django REST framework.</p> <p>The <a href="https://github.com/umutbozkurt/django-rest-framework-mongoengine">django-rest-framework-mongoengine</a> package provides a <code>MongoEngineModelSerializer</code> serializer class that supports using MongoDB as the storage layer for Django REST framework.</p>
<h2 id="geofeaturemodelserializer">GeoFeatureModelSerializer</h2> <h2 id="geofeaturemodelserializer">GeoFeatureModelSerializer</h2>

View File

@ -574,6 +574,7 @@ client.force_authenticate(user=user)
<pre><code>from django.core.urlresolvers import reverse <pre><code>from django.core.urlresolvers import reverse
from rest_framework import status from rest_framework import status
from rest_framework.test import APITestCase from rest_framework.test import APITestCase
from myproject.apps.core.models import Account
class AccountTests(APITestCase): class AccountTests(APITestCase):
def test_create_account(self): def test_create_account(self):
@ -584,7 +585,8 @@ class AccountTests(APITestCase):
data = {'name': 'DabApps'} data = {'name': 'DabApps'}
response = self.client.post(url, data, format='json') response = self.client.post(url, data, format='json')
self.assertEqual(response.status_code, status.HTTP_201_CREATED) self.assertEqual(response.status_code, status.HTTP_201_CREATED)
self.assertEqual(response.data, data) self.assertEqual(Account.objects.count(), 1)
self.assertEqual(Account.objects.get().name, 'DabApps')
</code></pre> </code></pre>
<hr /> <hr />
<h1 id="testing-responses">Testing responses</h1> <h1 id="testing-responses">Testing responses</h1>

View File

@ -509,7 +509,7 @@ class SustainedRateThrottle(UserRateThrottle):
throttle_scope = 'contacts' throttle_scope = 'contacts'
... ...
class ContactDetailView(ApiView): class ContactDetailView(APIView):
throttle_scope = 'contacts' throttle_scope = 'contacts'
... ...

File diff suppressed because one or more lines are too long

View File

@ -4,7 +4,7 @@
<url> <url>
<loc>http://www.django-rest-framework.org//</loc> <loc>http://www.django-rest-framework.org//</loc>
<lastmod>2015-08-24</lastmod> <lastmod>2015-09-11</lastmod>
<changefreq>daily</changefreq> <changefreq>daily</changefreq>
</url> </url>
@ -13,43 +13,43 @@
<url> <url>
<loc>http://www.django-rest-framework.org//tutorial/quickstart/</loc> <loc>http://www.django-rest-framework.org//tutorial/quickstart/</loc>
<lastmod>2015-08-24</lastmod> <lastmod>2015-09-11</lastmod>
<changefreq>daily</changefreq> <changefreq>daily</changefreq>
</url> </url>
<url> <url>
<loc>http://www.django-rest-framework.org//tutorial/1-serialization/</loc> <loc>http://www.django-rest-framework.org//tutorial/1-serialization/</loc>
<lastmod>2015-08-24</lastmod> <lastmod>2015-09-11</lastmod>
<changefreq>daily</changefreq> <changefreq>daily</changefreq>
</url> </url>
<url> <url>
<loc>http://www.django-rest-framework.org//tutorial/2-requests-and-responses/</loc> <loc>http://www.django-rest-framework.org//tutorial/2-requests-and-responses/</loc>
<lastmod>2015-08-24</lastmod> <lastmod>2015-09-11</lastmod>
<changefreq>daily</changefreq> <changefreq>daily</changefreq>
</url> </url>
<url> <url>
<loc>http://www.django-rest-framework.org//tutorial/3-class-based-views/</loc> <loc>http://www.django-rest-framework.org//tutorial/3-class-based-views/</loc>
<lastmod>2015-08-24</lastmod> <lastmod>2015-09-11</lastmod>
<changefreq>daily</changefreq> <changefreq>daily</changefreq>
</url> </url>
<url> <url>
<loc>http://www.django-rest-framework.org//tutorial/4-authentication-and-permissions/</loc> <loc>http://www.django-rest-framework.org//tutorial/4-authentication-and-permissions/</loc>
<lastmod>2015-08-24</lastmod> <lastmod>2015-09-11</lastmod>
<changefreq>daily</changefreq> <changefreq>daily</changefreq>
</url> </url>
<url> <url>
<loc>http://www.django-rest-framework.org//tutorial/5-relationships-and-hyperlinked-apis/</loc> <loc>http://www.django-rest-framework.org//tutorial/5-relationships-and-hyperlinked-apis/</loc>
<lastmod>2015-08-24</lastmod> <lastmod>2015-09-11</lastmod>
<changefreq>daily</changefreq> <changefreq>daily</changefreq>
</url> </url>
<url> <url>
<loc>http://www.django-rest-framework.org//tutorial/6-viewsets-and-routers/</loc> <loc>http://www.django-rest-framework.org//tutorial/6-viewsets-and-routers/</loc>
<lastmod>2015-08-24</lastmod> <lastmod>2015-09-11</lastmod>
<changefreq>daily</changefreq> <changefreq>daily</changefreq>
</url> </url>
@ -59,157 +59,157 @@
<url> <url>
<loc>http://www.django-rest-framework.org//api-guide/requests/</loc> <loc>http://www.django-rest-framework.org//api-guide/requests/</loc>
<lastmod>2015-08-24</lastmod> <lastmod>2015-09-11</lastmod>
<changefreq>daily</changefreq> <changefreq>daily</changefreq>
</url> </url>
<url> <url>
<loc>http://www.django-rest-framework.org//api-guide/responses/</loc> <loc>http://www.django-rest-framework.org//api-guide/responses/</loc>
<lastmod>2015-08-24</lastmod> <lastmod>2015-09-11</lastmod>
<changefreq>daily</changefreq> <changefreq>daily</changefreq>
</url> </url>
<url> <url>
<loc>http://www.django-rest-framework.org//api-guide/views/</loc> <loc>http://www.django-rest-framework.org//api-guide/views/</loc>
<lastmod>2015-08-24</lastmod> <lastmod>2015-09-11</lastmod>
<changefreq>daily</changefreq> <changefreq>daily</changefreq>
</url> </url>
<url> <url>
<loc>http://www.django-rest-framework.org//api-guide/generic-views/</loc> <loc>http://www.django-rest-framework.org//api-guide/generic-views/</loc>
<lastmod>2015-08-24</lastmod> <lastmod>2015-09-11</lastmod>
<changefreq>daily</changefreq> <changefreq>daily</changefreq>
</url> </url>
<url> <url>
<loc>http://www.django-rest-framework.org//api-guide/viewsets/</loc> <loc>http://www.django-rest-framework.org//api-guide/viewsets/</loc>
<lastmod>2015-08-24</lastmod> <lastmod>2015-09-11</lastmod>
<changefreq>daily</changefreq> <changefreq>daily</changefreq>
</url> </url>
<url> <url>
<loc>http://www.django-rest-framework.org//api-guide/routers/</loc> <loc>http://www.django-rest-framework.org//api-guide/routers/</loc>
<lastmod>2015-08-24</lastmod> <lastmod>2015-09-11</lastmod>
<changefreq>daily</changefreq> <changefreq>daily</changefreq>
</url> </url>
<url> <url>
<loc>http://www.django-rest-framework.org//api-guide/parsers/</loc> <loc>http://www.django-rest-framework.org//api-guide/parsers/</loc>
<lastmod>2015-08-24</lastmod> <lastmod>2015-09-11</lastmod>
<changefreq>daily</changefreq> <changefreq>daily</changefreq>
</url> </url>
<url> <url>
<loc>http://www.django-rest-framework.org//api-guide/renderers/</loc> <loc>http://www.django-rest-framework.org//api-guide/renderers/</loc>
<lastmod>2015-08-24</lastmod> <lastmod>2015-09-11</lastmod>
<changefreq>daily</changefreq> <changefreq>daily</changefreq>
</url> </url>
<url> <url>
<loc>http://www.django-rest-framework.org//api-guide/serializers/</loc> <loc>http://www.django-rest-framework.org//api-guide/serializers/</loc>
<lastmod>2015-08-24</lastmod> <lastmod>2015-09-11</lastmod>
<changefreq>daily</changefreq> <changefreq>daily</changefreq>
</url> </url>
<url> <url>
<loc>http://www.django-rest-framework.org//api-guide/fields/</loc> <loc>http://www.django-rest-framework.org//api-guide/fields/</loc>
<lastmod>2015-08-24</lastmod> <lastmod>2015-09-11</lastmod>
<changefreq>daily</changefreq> <changefreq>daily</changefreq>
</url> </url>
<url> <url>
<loc>http://www.django-rest-framework.org//api-guide/relations/</loc> <loc>http://www.django-rest-framework.org//api-guide/relations/</loc>
<lastmod>2015-08-24</lastmod> <lastmod>2015-09-11</lastmod>
<changefreq>daily</changefreq> <changefreq>daily</changefreq>
</url> </url>
<url> <url>
<loc>http://www.django-rest-framework.org//api-guide/validators/</loc> <loc>http://www.django-rest-framework.org//api-guide/validators/</loc>
<lastmod>2015-08-24</lastmod> <lastmod>2015-09-11</lastmod>
<changefreq>daily</changefreq> <changefreq>daily</changefreq>
</url> </url>
<url> <url>
<loc>http://www.django-rest-framework.org//api-guide/authentication/</loc> <loc>http://www.django-rest-framework.org//api-guide/authentication/</loc>
<lastmod>2015-08-24</lastmod> <lastmod>2015-09-11</lastmod>
<changefreq>daily</changefreq> <changefreq>daily</changefreq>
</url> </url>
<url> <url>
<loc>http://www.django-rest-framework.org//api-guide/permissions/</loc> <loc>http://www.django-rest-framework.org//api-guide/permissions/</loc>
<lastmod>2015-08-24</lastmod> <lastmod>2015-09-11</lastmod>
<changefreq>daily</changefreq> <changefreq>daily</changefreq>
</url> </url>
<url> <url>
<loc>http://www.django-rest-framework.org//api-guide/throttling/</loc> <loc>http://www.django-rest-framework.org//api-guide/throttling/</loc>
<lastmod>2015-08-24</lastmod> <lastmod>2015-09-11</lastmod>
<changefreq>daily</changefreq> <changefreq>daily</changefreq>
</url> </url>
<url> <url>
<loc>http://www.django-rest-framework.org//api-guide/filtering/</loc> <loc>http://www.django-rest-framework.org//api-guide/filtering/</loc>
<lastmod>2015-08-24</lastmod> <lastmod>2015-09-11</lastmod>
<changefreq>daily</changefreq> <changefreq>daily</changefreq>
</url> </url>
<url> <url>
<loc>http://www.django-rest-framework.org//api-guide/pagination/</loc> <loc>http://www.django-rest-framework.org//api-guide/pagination/</loc>
<lastmod>2015-08-24</lastmod> <lastmod>2015-09-11</lastmod>
<changefreq>daily</changefreq> <changefreq>daily</changefreq>
</url> </url>
<url> <url>
<loc>http://www.django-rest-framework.org//api-guide/versioning/</loc> <loc>http://www.django-rest-framework.org//api-guide/versioning/</loc>
<lastmod>2015-08-24</lastmod> <lastmod>2015-09-11</lastmod>
<changefreq>daily</changefreq> <changefreq>daily</changefreq>
</url> </url>
<url> <url>
<loc>http://www.django-rest-framework.org//api-guide/content-negotiation/</loc> <loc>http://www.django-rest-framework.org//api-guide/content-negotiation/</loc>
<lastmod>2015-08-24</lastmod> <lastmod>2015-09-11</lastmod>
<changefreq>daily</changefreq> <changefreq>daily</changefreq>
</url> </url>
<url> <url>
<loc>http://www.django-rest-framework.org//api-guide/metadata/</loc> <loc>http://www.django-rest-framework.org//api-guide/metadata/</loc>
<lastmod>2015-08-24</lastmod> <lastmod>2015-09-11</lastmod>
<changefreq>daily</changefreq> <changefreq>daily</changefreq>
</url> </url>
<url> <url>
<loc>http://www.django-rest-framework.org//api-guide/format-suffixes/</loc> <loc>http://www.django-rest-framework.org//api-guide/format-suffixes/</loc>
<lastmod>2015-08-24</lastmod> <lastmod>2015-09-11</lastmod>
<changefreq>daily</changefreq> <changefreq>daily</changefreq>
</url> </url>
<url> <url>
<loc>http://www.django-rest-framework.org//api-guide/reverse/</loc> <loc>http://www.django-rest-framework.org//api-guide/reverse/</loc>
<lastmod>2015-08-24</lastmod> <lastmod>2015-09-11</lastmod>
<changefreq>daily</changefreq> <changefreq>daily</changefreq>
</url> </url>
<url> <url>
<loc>http://www.django-rest-framework.org//api-guide/exceptions/</loc> <loc>http://www.django-rest-framework.org//api-guide/exceptions/</loc>
<lastmod>2015-08-24</lastmod> <lastmod>2015-09-11</lastmod>
<changefreq>daily</changefreq> <changefreq>daily</changefreq>
</url> </url>
<url> <url>
<loc>http://www.django-rest-framework.org//api-guide/status-codes/</loc> <loc>http://www.django-rest-framework.org//api-guide/status-codes/</loc>
<lastmod>2015-08-24</lastmod> <lastmod>2015-09-11</lastmod>
<changefreq>daily</changefreq> <changefreq>daily</changefreq>
</url> </url>
<url> <url>
<loc>http://www.django-rest-framework.org//api-guide/testing/</loc> <loc>http://www.django-rest-framework.org//api-guide/testing/</loc>
<lastmod>2015-08-24</lastmod> <lastmod>2015-09-11</lastmod>
<changefreq>daily</changefreq> <changefreq>daily</changefreq>
</url> </url>
<url> <url>
<loc>http://www.django-rest-framework.org//api-guide/settings/</loc> <loc>http://www.django-rest-framework.org//api-guide/settings/</loc>
<lastmod>2015-08-24</lastmod> <lastmod>2015-09-11</lastmod>
<changefreq>daily</changefreq> <changefreq>daily</changefreq>
</url> </url>
@ -219,85 +219,85 @@
<url> <url>
<loc>http://www.django-rest-framework.org//topics/documenting-your-api/</loc> <loc>http://www.django-rest-framework.org//topics/documenting-your-api/</loc>
<lastmod>2015-08-24</lastmod> <lastmod>2015-09-11</lastmod>
<changefreq>daily</changefreq> <changefreq>daily</changefreq>
</url> </url>
<url> <url>
<loc>http://www.django-rest-framework.org//topics/internationalization/</loc> <loc>http://www.django-rest-framework.org//topics/internationalization/</loc>
<lastmod>2015-08-24</lastmod> <lastmod>2015-09-11</lastmod>
<changefreq>daily</changefreq> <changefreq>daily</changefreq>
</url> </url>
<url> <url>
<loc>http://www.django-rest-framework.org//topics/ajax-csrf-cors/</loc> <loc>http://www.django-rest-framework.org//topics/ajax-csrf-cors/</loc>
<lastmod>2015-08-24</lastmod> <lastmod>2015-09-11</lastmod>
<changefreq>daily</changefreq> <changefreq>daily</changefreq>
</url> </url>
<url> <url>
<loc>http://www.django-rest-framework.org//topics/browser-enhancements/</loc> <loc>http://www.django-rest-framework.org//topics/browser-enhancements/</loc>
<lastmod>2015-08-24</lastmod> <lastmod>2015-09-11</lastmod>
<changefreq>daily</changefreq> <changefreq>daily</changefreq>
</url> </url>
<url> <url>
<loc>http://www.django-rest-framework.org//topics/browsable-api/</loc> <loc>http://www.django-rest-framework.org//topics/browsable-api/</loc>
<lastmod>2015-08-24</lastmod> <lastmod>2015-09-11</lastmod>
<changefreq>daily</changefreq> <changefreq>daily</changefreq>
</url> </url>
<url> <url>
<loc>http://www.django-rest-framework.org//topics/rest-hypermedia-hateoas/</loc> <loc>http://www.django-rest-framework.org//topics/rest-hypermedia-hateoas/</loc>
<lastmod>2015-08-24</lastmod> <lastmod>2015-09-11</lastmod>
<changefreq>daily</changefreq> <changefreq>daily</changefreq>
</url> </url>
<url> <url>
<loc>http://www.django-rest-framework.org//topics/third-party-resources/</loc> <loc>http://www.django-rest-framework.org//topics/third-party-resources/</loc>
<lastmod>2015-08-24</lastmod> <lastmod>2015-09-11</lastmod>
<changefreq>daily</changefreq> <changefreq>daily</changefreq>
</url> </url>
<url> <url>
<loc>http://www.django-rest-framework.org//topics/contributing/</loc> <loc>http://www.django-rest-framework.org//topics/contributing/</loc>
<lastmod>2015-08-24</lastmod> <lastmod>2015-09-11</lastmod>
<changefreq>daily</changefreq> <changefreq>daily</changefreq>
</url> </url>
<url> <url>
<loc>http://www.django-rest-framework.org//topics/project-management/</loc> <loc>http://www.django-rest-framework.org//topics/project-management/</loc>
<lastmod>2015-08-24</lastmod> <lastmod>2015-09-11</lastmod>
<changefreq>daily</changefreq> <changefreq>daily</changefreq>
</url> </url>
<url> <url>
<loc>http://www.django-rest-framework.org//topics/3.0-announcement/</loc> <loc>http://www.django-rest-framework.org//topics/3.0-announcement/</loc>
<lastmod>2015-08-24</lastmod> <lastmod>2015-09-11</lastmod>
<changefreq>daily</changefreq> <changefreq>daily</changefreq>
</url> </url>
<url> <url>
<loc>http://www.django-rest-framework.org//topics/3.1-announcement/</loc> <loc>http://www.django-rest-framework.org//topics/3.1-announcement/</loc>
<lastmod>2015-08-24</lastmod> <lastmod>2015-09-11</lastmod>
<changefreq>daily</changefreq> <changefreq>daily</changefreq>
</url> </url>
<url> <url>
<loc>http://www.django-rest-framework.org//topics/3.2-announcement/</loc> <loc>http://www.django-rest-framework.org//topics/3.2-announcement/</loc>
<lastmod>2015-08-24</lastmod> <lastmod>2015-09-11</lastmod>
<changefreq>daily</changefreq> <changefreq>daily</changefreq>
</url> </url>
<url> <url>
<loc>http://www.django-rest-framework.org//topics/kickstarter-announcement/</loc> <loc>http://www.django-rest-framework.org//topics/kickstarter-announcement/</loc>
<lastmod>2015-08-24</lastmod> <lastmod>2015-09-11</lastmod>
<changefreq>daily</changefreq> <changefreq>daily</changefreq>
</url> </url>
<url> <url>
<loc>http://www.django-rest-framework.org//topics/release-notes/</loc> <loc>http://www.django-rest-framework.org//topics/release-notes/</loc>
<lastmod>2015-08-24</lastmod> <lastmod>2015-09-11</lastmod>
<changefreq>daily</changefreq> <changefreq>daily</changefreq>
</url> </url>

View File

@ -475,15 +475,16 @@ form.signup {
<p>With <em>typical corporate fundings of just £100-£1000 per organization</em> we successfully delivered:</p> <p>With <em>typical corporate fundings of just £100-£1000 per organization</em> we successfully delivered:</p>
<ul> <ul>
<li>The comprehensive 3.0 serializer redesign.</li> <li>The comprehensive 3.0 serializer redesign.</li>
<li>Pagination API including new offset/limit and cursor pagination implementations, plus on-page controls.</li> <li>Substantial improvements to the Browsable API.</li>
<li>The versioning API, including URL based and header based versioning schemes.</li> <li>The admin interface.</li>
<li>Customizable exception handling.</li> <li>A new pagination API including offset/limit and cursor pagination implementations, plus on-page controls.</li>
<li>The metadata APIs for handling <code>OPTIONS</code> requests.</li> <li>A versioning API, including URL-based and header-based versioning schemes.</li>
<li>Support for customizable exception handling.</li>
<li>Support for Django's PostgreSQL HStoreField, ArrayField and JSONField.</li>
<li>Templated HTML form support, including HTML forms with nested list and objects.</li> <li>Templated HTML form support, including HTML forms with nested list and objects.</li>
<li>Internationalization support for API responses, currently with 27 languages.</li> <li>Internationalization support for API responses, currently with 27 languages.</li>
<li>Improvements to the browsable API.</li> <li>The metadata APIs for handling <code>OPTIONS</code> requests and schema endpoints.</li>
<li>The admin interface.</li> <li>Numerous minor improvements and better quality throughout the codebase.</li>
<li>Support for Django's PostgreSQL HStoreField, ArrayField and JSONField.</li>
<li>Ongoing triage and community support, closing over 1600 tickets.</li> <li>Ongoing triage and community support, closing over 1600 tickets.</li>
</ul> </ul>
<p>This incredible level of return on investment is <em>only possible through collaboratively funded models</em>, which is why we believe that supporting our paid plans is in everyone's best interest.</p> <p>This incredible level of return on investment is <em>only possible through collaboratively funded models</em>, which is why we believe that supporting our paid plans is in everyone's best interest.</p>
@ -642,21 +643,28 @@ form.signup {
<p>For further enquires please contact <a href=mailto:tom@tomchristie.com>tom@tomchristie.com</a>.</p> <p>For further enquires please contact <a href=mailto:tom@tomchristie.com>tom@tomchristie.com</a>.</p>
<hr /> <hr />
<h2 id="roadmap">Roadmap</h2> <h2 id="roadmap">Roadmap</h2>
<p>Although we're incredibly proud of REST framework in its current state we believe there is still huge scope for improvement. What we're aiming for here is a <em>highly polished, rock solid product</em>. This needs to backed up with impeccable documentation and a great third party ecosystem.</p>
<p>The roadmap below is a broad indication of just some of the ongoing and future work we believe is important to REST framework.</p> <p>The roadmap below is a broad indication of just some of the ongoing and future work we believe is important to REST framework.</p>
<ul> <ul>
<li>Support for alternative backends such as SQLAlchemy.</li> <li>Increasing our "bus factor" through documented organizational process &amp; safeguards.</li>
<li>HTTP Caching API &amp; support for conditional database lookups.</li> <li>More time towards testing and hardening releases, with only gradual, well-documented deprecations.</li>
<li>Performance improvements.</li> <li>A formal policy on security backports for non-current releases.</li>
<li>Continuing triage &amp; community support.</li>
<li>Improved project documentation, including versioned &amp; internationalized docs.</li> <li>Improved project documentation, including versioned &amp; internationalized docs.</li>
<li>Improved third party package visibility.</li>
<li>Refining the admin interface, ensuring it has a fully customizable API and making it suitable as end-user facing application.</li>
<li>Cleaning up internal complexities including the <code>BrowsableAPIRenderer</code> and <code>Request</code> object.</li>
<li>Support for alternative backends such as SQLAlchemy.</li>
<li>Support for non-database backed services.</li>
<li>HTTP Caching API &amp; support for conditional database lookups.</li>
<li>Benchmarking and performance improvements.</li>
<li>In depth documentation on advanced usage and best practices.</li>
<li>Documentation &amp; support for integration with realtime systems.</li>
<li>Hypermedia support and client libraries.</li> <li>Hypermedia support and client libraries.</li>
<li>Support for JSON schema as endpoints or <code>OPTIONS</code> responses.</li>
<li>API metric tools.</li> <li>API metric tools.</li>
<li>Debug &amp; logging tools.</li> <li>Debug &amp; logging tools.</li>
<li>In depth documentation on advanced usage and best practices.</li>
<li>Third party GraphQL support.</li> <li>Third party GraphQL support.</li>
<li>Documentation &amp; support for integration with realtime systems.</li>
<li>Improved third party package visibility.</li>
<li>Increasing our "bus factor" through documented organizational process &amp; safeguards.</li>
<li>Continuing triage &amp; community support.</li>
</ul> </ul>
<p>By taking out a paid plan you'll be directly contributing towards making these features happen.</p> <p>By taking out a paid plan you'll be directly contributing towards making these features happen.</p>

View File

@ -536,6 +536,7 @@ You probably want to also tag the version now:
<h3 id="filtering">Filtering</h3> <h3 id="filtering">Filtering</h3>
<ul> <ul>
<li><a href="https://github.com/philipn/django-rest-framework-chain">djangorestframework-chain</a> - Allows arbitrary chaining of both relations and lookup filters.</li> <li><a href="https://github.com/philipn/django-rest-framework-chain">djangorestframework-chain</a> - Allows arbitrary chaining of both relations and lookup filters.</li>
<li><a href="https://github.com/miki725/django-url-filter">django-url-filter</a> - Allows a safe way to filter data via human-friendly URLs. It is a generic library which is not tied to DRF but it provides easy integration with DRF.</li>
</ul> </ul>
<h3 id="misc">Misc</h3> <h3 id="misc">Misc</h3>
<ul> <ul>

View File

@ -411,7 +411,7 @@ class SnippetViewSet(viewsets.ModelViewSet):
return Response(snippet.highlighted) return Response(snippet.highlighted)
def perform_create(self, serializer): def perform_create(self, serializer):
serializer.save(owner=self.request.user) serializer.save(owner=self.request.user)
</code></pre> </code></pre>
<p>This time we've used the <code>ModelViewSet</code> class in order to get the complete set of default read and write operations.</p> <p>This time we've used the <code>ModelViewSet</code> class in order to get the complete set of default read and write operations.</p>
<p>Notice that we've also used the <code>@detail_route</code> decorator to create a custom action, named <code>highlight</code>. This decorator can be used to add any custom endpoints that don't fit into the standard <code>create</code>/<code>update</code>/<code>delete</code> style.</p> <p>Notice that we've also used the <code>@detail_route</code> decorator to create a custom action, named <code>highlight</code>. This decorator can be used to add any custom endpoints that don't fit into the standard <code>create</code>/<code>update</code>/<code>delete</code> style.</p>