4
4
The DJA package implements a custom renderer, parser, exception handler, and
5
5
pagination. To get started enable the pieces in ` settings.py ` that you want to use.
6
6
7
- Many features of the JSON: API format standard have been implemented using Mixin classes in ` serializers.py ` .
8
- The easiest way to make use of those features is to import ModelSerializer variants
7
+ Many features of the JSON: API format standard have been implemented using Mixin classes in ` serializers.py ` .
8
+ The easiest way to make use of those features is to import ModelSerializer variants
9
9
from ` rest_framework_json_api ` instead of the usual ` rest_framework `
10
10
11
11
### Configuration
12
12
We suggest that you simply copy the settings block below and modify it if necessary.
13
13
``` python
14
14
REST_FRAMEWORK = {
15
- ' PAGINATE_BY ' : 10 ,
15
+ ' PAGE_SIZE ' : 10 ,
16
16
' PAGINATE_BY_PARAM' : ' page_size' ,
17
17
' MAX_PAGINATE_BY' : 100 ,
18
18
# DRF v3.1+
@@ -33,9 +33,10 @@ REST_FRAMEWORK = {
33
33
}
34
34
```
35
35
36
- If ` PAGINATE_BY ` is set the renderer will return a ` meta ` object with
36
+ If ` PAGE_SIZE ` is set the renderer will return a ` meta ` object with
37
37
record count and a ` links ` object with the next, previous, first, and last links.
38
- Pages can be selected with the ` page ` GET parameter.
38
+ Pages can be selected with the ` page ` GET parameter. Page size can be controlled
39
+ per request via the ` PAGINATE_BY_PARAM ` query parameter (` page_size ` by default).
39
40
40
41
### Setting the resource_name
41
42
@@ -226,7 +227,7 @@ When set to pluralize:
226
227
}
227
228
```
228
229
229
- Both ` JSON_API_PLURALIZE_RELATION_TYPE ` and ` JSON_API_FORMAT_RELATION_KEYS ` can be combined to
230
+ Both ` JSON_API_PLURALIZE_RELATION_TYPE ` and ` JSON_API_FORMAT_RELATION_KEYS ` can be combined to
230
231
achieve different results.
231
232
232
233
### Meta
@@ -248,7 +249,7 @@ def get_root_meta(self, obj):
248
249
```
249
250
to the serializer. It must return a dict and will be merged with the existing top level ` meta ` .
250
251
251
- <!--
252
+ <!--
252
253
### Relationships
253
254
### Links
254
255
### Included
0 commit comments