Skip to content

Commit 1d4956f

Browse files
committed
Pagination images
1 parent 53716f6 commit 1d4956f

File tree

4 files changed

+32
-5
lines changed

4 files changed

+32
-5
lines changed

docs/img/cursor-pagination.png

11.9 KB
Loading

docs/img/pages-pagination.png

9.99 KB
Loading

docs/topics/3.1-announcement.md

Lines changed: 28 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,17 @@
22

33
The 3.1 release is an intermediate step in the Kickstarter project releases, and includes a range of new functionality.
44

5+
Some highlights include:
6+
7+
* A super-smart cursor pagination scheme.
8+
* An improved pagination API, supporting header or in-body pagination styles.
9+
* Pagination controls rendering in the browsable API.
10+
* Better support for API versioning.
11+
* Built-in internalization support.
12+
* Support for Django 1.8's `HStoreField` and `ArrayField`.
13+
14+
---
15+
516
## Pagination
617

718
The pagination API has been improved, making it both easier to use, and more powerful.
@@ -14,20 +25,22 @@ The cursor based pagination scheme is particularly smart, and is a better approa
1425

1526
#### Pagination controls in the browsable API.
1627

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.
28+
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:
1829

19-
**IMAGE**
30+
![page number based pagination](../img/pages-pagination.png )
2031

21-
The cursor based pagination renders a more simple 'Previous'/'Next' control.
32+
The cursor based pagination renders a more simple style of control:
2233

23-
**IMAGE**
34+
![cursor based pagination](../img/cursor-pagination.png )
2435

2536
#### Support for header-based pagination.
2637

2738
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.
2839

2940
For more information, see the [custom pagination styles](../api-guide/pagination/#custom-pagination-styles) documentation.
3041

42+
---
43+
3144
## Versioning
3245

3346
We've made it easier to build versioned APIs. Built-in schemes for versioning include both URL based and Accept header based variations.
@@ -54,6 +67,8 @@ The output representation would match the version used on the incoming request.
5467
]
5568
}
5669

70+
---
71+
5772
## Internationalization
5873

5974
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.
@@ -103,6 +118,8 @@ For more details, see the [internationalization documentation](internationalizat
103118

104119
Many thanks to [Craig Blaszczyk](https://github.com/jakul) for helping push this through.
105120

121+
---
122+
106123
## New field types
107124

108125
Django 1.8's new `ArrayField`, `HStoreField` and `UUIDField` are now all fully supported.
@@ -113,12 +130,16 @@ If you're building a new 1.8 project, then you should probably consider using `U
113130

114131
http://example.org/api/purchases/9b1a433f-e90d-4948-848b-300fdc26365d
115132

133+
---
134+
116135
## ModelSerializer API
117136

118137
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.
119138

120139
For more information, see the documentation on [customizing field mappings](../api-guide/serializers/#customizing-field-mappings) for ModelSerializer classes.
121140

141+
---
142+
122143
## Moving packages out of core
123144

124145
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.
@@ -150,7 +171,9 @@ And modify your settings, like so:
150171

151172
Thanks go to the latest member of our maintenance team, [José Padilla](https://github.com/jpadilla/), for handling this work and taking on ownership of these packages.
152173

153-
# What's next?
174+
---
175+
176+
## What's next?
154177

155178
The next focus will be on HTML renderings of API output and will include:
156179

docs_theme/css/default.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,10 @@ body{
186186
margin-top: 15px
187187
}
188188

189+
#main-content img {
190+
display: block;
191+
margin: 40px auto;
192+
}
189193
/* custom navigation styles */
190194

191195
.navbar .navbar-inner{

0 commit comments

Comments
 (0)