Skip to content

Commit d015534

Browse files
committed
Fleshing out 3.1 announcement
1 parent e63f49b commit d015534

File tree

1 file changed

+67
-2
lines changed

1 file changed

+67
-2
lines changed

docs/topics/3.1-announcement.md

Lines changed: 67 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,82 @@
11
# Django REST framework 3.1
22

3+
The 3.1 release is an intermediate step in the Kickstarter project releases, and includes a range of new functionality.
4+
35
## Pagination
46

7+
The pagination API has been improved, making it both easier to use, and more powerful.
8+
9+
#### New pagination schemes.
10+
11+
Until now, there has only been a single built-in pagination style in REST framework. We now have page, limit/offset and cursor based schemes included by default.
12+
13+
The cursor based pagination scheme is particularly smart, and is a better approach for clients iterating through large or frequently changing result sets. The scheme supports paging against non-unique indexes, by using both cursor and limit/offset information. Credit to David Cramer for [this blog post](http://cramer.io/2011/03/08/building-cursors-for-the-disqus-api/) on the subject.
14+
515
#### Pagination controls in the browsable API.
616

7-
#### New schemes, including cursor pagination.
17+
Paginated results now include controls that render directly in the browsable API. If you're using the page or limit/offset style, then you'll see a page based control displayed in the browsable API.
18+
19+
**IMAGE**
20+
21+
The cursor based pagination renders a more simple 'Previous'/'Next' control.
22+
23+
**IMAGE**
824

925
#### Support for header-based pagination.
1026

27+
The pagination API was previously only able to alter the pagination style in the body of the response. The API now supports being able to write pagination information in response headers, making it possible to use pagination schemes that use the `Link` or `Content-Range` headers.
28+
29+
**TODO**: Link to docs.
30+
1131
## Versioning
1232

33+
We've made it easier to build versioned APIs. Built-in schemes for versioning include both URL based and Accept header based variations.
34+
35+
When using a URL based scheme, hyperlinked serializers will resolve relationships to the same API version as used on the incoming request.
36+
37+
**TODO**: Example.
38+
1339
## Internationalization
1440

15-
## New fields
41+
REST framework now includes a built-in set of translations, and supports internationalized error responses. This allows you to either change the default language, or to allow clients to specify the language via the `Accept-Language` header.
42+
43+
**TODO**: Example.
44+
45+
**TODO**: Credit.
46+
47+
## New field types
48+
49+
Django 1.8's new `ArrayField`, `HStoreField` and `UUIDField` are now all fully supported.
50+
51+
This work also means that we now have both `serializers.DictField()`, and `serializers.ListField()` types, allowing you to express and validate a wider set of representations.
1652

1753
## ModelSerializer API
54+
55+
The serializer redesign in 3.0 did not include any public API for modifying how ModelSerializer classes automatically generate a set of fields from a given mode class. We've now re-introduced an API for this, allowing you to create new ModelSerializer base classes that behave differently, such as using a different default style for relationships.
56+
57+
**TODO**: Link to docs.
58+
59+
## Moving packages out of core
60+
61+
We've now moved a number of packages out of the core of REST framework, and into separately installable packages. If you're currently using these you don't need to worry, you simply need to `pip install` the new packages, and change any import paths.
62+
63+
We're making this change in order to distribute the maintainance workload, and keep better focus of the core essentials of the framework.
64+
65+
The change also means we can be more flexible with which external packages we recommend. For example, the excellently maintained [Django OAuth toolkit](https://github.com/evonove/django-oauth-toolkit) is now our recommended option for integrating OAuth support.
66+
67+
**TODO** Links and package names
68+
69+
* XML
70+
* YAML
71+
* JSONP
72+
* OAuth
73+
74+
# What's next?
75+
76+
The next focus will be on HTML renderings of API output and will include:
77+
78+
* HTML form rendering of serializers.
79+
* Filtering controls built-in to the browsable API.
80+
* An alternative admin-style interface.
81+
82+
This will either be made as a single 3.2 release, or split across two separate releases, with the HTML forms and filter controls coming in 3.2, and the admin-style interface coming in a 3.3 release.

0 commit comments

Comments
 (0)