Skip to content

Commit d46d860

Browse files
committed
Merge pull request #2655 from jwbixby/patch-1
Update documentation over PAGE_SIZE
2 parents dfd6a1f + c2cbda4 commit d46d860

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

docs/api-guide/pagination.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -80,11 +80,11 @@ This pagination style accepts a single number page number in the request query p
8080

8181
#### Setup
8282

83-
To enable the `PageNumberPagination` style globally, use the following configuration, modifying the `DEFAULT_PAGE_SIZE` as desired:
83+
To enable the `PageNumberPagination` style globally, use the following configuration, modifying the `PAGE_SIZE` as desired:
8484

8585
REST_FRAMEWORK = {
8686
'DEFAULT_PAGINATION_CLASS': 'rest_framework.pagination.PageNumberPagination',
87-
'DEFAULT_PAGE_SIZE': 100
87+
'PAGE_SIZE': 100
8888
}
8989

9090
On `GenericAPIView` subclasses you may also set the `pagination_class` attribute to select `PageNumberPagination` on a per-view basis.
@@ -95,7 +95,7 @@ The `PageNumberPagination` class includes a number of attributes that may be ove
9595

9696
To set these attributes you should override the `PageNumberPagination` class, and then enable your custom pagination class as above.
9797

98-
* `page_size` - A numeric value indicating the page size. If set, this overrides the `DEFAULT_PAGE_SIZE` setting. Defaults to the same value as the `DEFAULT_PAGE_SIZE` settings key.
98+
* `page_size` - A numeric value indicating the page size. If set, this overrides the `PAGE_SIZE` setting. Defaults to the same value as the `PAGE_SIZE` settings key.
9999
* `page_query_param` - A string value indicating the name of the query parameter to use for the pagination control.
100100
* `page_size_query_param` - If set, this is a string value indicating the name of a query parameter that allows the client to set the page size on a per-request basis. Defaults to `None`, indicating that the client may not control the requested page size.
101101
* `max_page_size` - If set, this is a numeric value indicating the maximum allowable requested page size. This attribute is only valid if `page_size_query_param` is also set.
@@ -133,7 +133,7 @@ To enable the `PageNumberPagination` style globally, use the following configura
133133
'DEFAULT_PAGINATION_CLASS': 'rest_framework.pagination.LimitOffsetPagination'
134134
}
135135

136-
Optionally, you may also set a `DEFAULT_PAGE_SIZE` key. If the `DEFAULT_PAGE_SIZE` parameter is also used then the `limit` query parameter will be optional, and may be omitted by the client.
136+
Optionally, you may also set a `PAGE_SIZE` key. If the `PAGE_SIZE` parameter is also used then the `limit` query parameter will be optional, and may be omitted by the client.
137137

138138
On `GenericAPIView` subclasses you may also set the `pagination_class` attribute to select `LimitOffsetPagination` on a per-view basis.
139139

@@ -143,7 +143,7 @@ The `LimitOffsetPagination` class includes a number of attributes that may be ov
143143

144144
To set these attributes you should override the `LimitOffsetPagination` class, and then enable your custom pagination class as above.
145145

146-
* `default_limit` - A numeric value indicating the limit to use if one is not provided by the client in a query parameter. Defaults to the same value as the `DEFAULT_PAGE_SIZE` settings key.
146+
* `default_limit` - A numeric value indicating the limit to use if one is not provided by the client in a query parameter. Defaults to the same value as the `PAGE_SIZE` settings key.
147147
* `limit_query_param` - A string value indicating the name of the "limit" query parameter. Defaults to `'limit'`.
148148
* `offset_query_param` - A string value indicating the name of the "offset" query parameter. Defaults to `'offset'`.
149149
* `max_limit` - If set this is a numeric value indicating the maximum allowable limit that may be requested by the client. Defaults to `None`.
@@ -181,11 +181,11 @@ For more technical details on the implementation we use for cursor pagination, t
181181

182182
#### Setup
183183

184-
To enable the `CursorPagination` style globally, use the following configuration, modifying the `DEFAULT_PAGE_SIZE` as desired:
184+
To enable the `CursorPagination` style globally, use the following configuration, modifying the `PAGE_SIZE` as desired:
185185

186186
REST_FRAMEWORK = {
187187
'DEFAULT_PAGINATION_CLASS': 'rest_framework.pagination.CursorPagination',
188-
'DEFAULT_PAGE_SIZE': 100
188+
'PAGE_SIZE': 100
189189
}
190190

191191
On `GenericAPIView` subclasses you may also set the `pagination_class` attribute to select `CursorPagination` on a per-view basis.

0 commit comments

Comments
 (0)