44The DJA package implements a custom renderer, parser, exception handler, and
55pagination. To get started enable the pieces in ` settings.py ` that you want to use.
66
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
99from ` rest_framework_json_api ` instead of the usual ` rest_framework `
1010
1111### Configuration
1212We suggest that you simply copy the settings block below and modify it if necessary.
1313``` python
1414REST_FRAMEWORK = {
15- ' PAGINATE_BY ' : 10 ,
15+ ' PAGE_SIZE ' : 10 ,
1616 ' PAGINATE_BY_PARAM' : ' page_size' ,
1717 ' MAX_PAGINATE_BY' : 100 ,
1818 # DRF v3.1+
@@ -33,9 +33,10 @@ REST_FRAMEWORK = {
3333}
3434```
3535
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
3737record 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).
3940
4041### Setting the resource_name
4142
@@ -226,7 +227,7 @@ When set to pluralize:
226227}
227228```
228229
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
230231achieve different results.
231232
232233### Meta
@@ -248,7 +249,7 @@ def get_root_meta(self, obj):
248249```
249250to the serializer. It must return a dict and will be merged with the existing top level ` meta ` .
250251
251- <!--
252+ <!--
252253### Relationships
253254### Links
254255### Included
0 commit comments