diff options
| author | Peter Inglesby | 2014-03-06 21:39:44 +0000 | 
|---|---|---|
| committer | Peter Inglesby | 2014-03-06 21:39:44 +0000 | 
| commit | 2353878951b0607a95d539c27c362d0353c53119 (patch) | |
| tree | 00d1f5159b5bc0f373348e00fa7abb5e72c6e3d6 /docs/api-guide | |
| parent | ef94861c2d31592c3760a0c0758beb084f452c03 (diff) | |
| download | django-rest-framework-2353878951b0607a95d539c27c362d0353c53119.tar.bz2 | |
Add SEARCH_PARAM and ORDERING_PARAM to settings
Fixes #1434
Diffstat (limited to 'docs/api-guide')
| -rw-r--r-- | docs/api-guide/filtering.md | 6 | ||||
| -rw-r--r-- | docs/api-guide/settings.md | 12 | 
2 files changed, 17 insertions, 1 deletions
| diff --git a/docs/api-guide/filtering.md b/docs/api-guide/filtering.md index 07420d84..d6c4b1c1 100644 --- a/docs/api-guide/filtering.md +++ b/docs/api-guide/filtering.md @@ -264,13 +264,17 @@ For example:      search_fields = ('=username', '=email') +By default, the search parameter is named `'search`', but this may be overridden with the `SEARCH_PARAM` setting. +  For more details, see the [Django documentation][search-django-admin].  ---  ## OrderingFilter -The `OrderingFilter` class supports simple query parameter controlled ordering of results.  To specify the result order, set a query parameter named `'ordering'` to the required field name.  For example: +The `OrderingFilter` class supports simple query parameter controlled ordering of results.  By default, the query parameter is named `'ordering'`, but this may by overridden with the `ORDERING_PARAM` setting. + +For example, to order users by username:      http://example.com/api/users?ordering=username diff --git a/docs/api-guide/settings.md b/docs/api-guide/settings.md index 5aee52aa..c979019f 100644 --- a/docs/api-guide/settings.md +++ b/docs/api-guide/settings.md @@ -158,6 +158,18 @@ A client request like the following would return a paginated list of up to 100 i  Default: `None` +### SEARCH_PARAM + +The name of a query paramater, which can be used to specify the search term used by `SearchFilter`. + +Default: `search` + +#### ORDERING_PARAM + +The name of a query paramater, which can be used to specify the ordering of results returned by `OrderingFilter`. + +Default: `ordering` +  ---  ## Authentication settings | 
