diff options
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/api-guide/settings.md | 34 | ||||
| -rw-r--r-- | docs/index.md | 2 | ||||
| -rw-r--r-- | docs/template.html | 1 | ||||
| -rw-r--r-- | docs/topics/credits.md | 2 | ||||
| -rw-r--r-- | docs/topics/release-notes.md | 12 |
5 files changed, 48 insertions, 3 deletions
diff --git a/docs/api-guide/settings.md b/docs/api-guide/settings.md index 0be0eb24..fe7925a5 100644 --- a/docs/api-guide/settings.md +++ b/docs/api-guide/settings.md @@ -274,6 +274,40 @@ Default: `['iso-8601']` --- +## View names and descriptions + +**The following settings are used to generate the view names and descriptions, as used in responses to `OPTIONS` requests, and as used in the browsable API.** + +#### VIEW_NAME_FUNCTION + +A string representing the function that should be used when generating view names. + +This should be a function with the following signature: + + view_name(cls, suffix=None) + +* `cls`: The view class. Typically the name function would inspect the name of the class when generating a descriptive name, by accessing `cls.__name__`. +* `suffix`: The optional suffix used when differentiating individual views in a viewset. + +Default: `'rest_framework.views.get_view_name'` + +#### VIEW_DESCRIPTION_FUNCTION + +A string representing the function that should be used when generating view descriptions. + +This setting can be changed to support markup styles other than the default markdown. For example, you can use it to support `rst` markup in your view docstrings being output in the browsable API. + +This should be a function with the following signature: + + view_description(cls, html=False) + +* `cls`: The view class. Typically the description function would inspect the docstring of the class when generating a description, by accessing `cls.__doc__` +* `html`: A boolean indicating if HTML output is required. `True` when used in the browsable API, and `False` when used in generating `OPTIONS` responses. + +Default: `'rest_framework.views.get_view_description'` + +--- + ## Miscellaneous settings #### FORMAT_SUFFIX_KWARG diff --git a/docs/index.md b/docs/index.md index 99cd6b88..a0ae2984 100644 --- a/docs/index.md +++ b/docs/index.md @@ -164,6 +164,7 @@ The API guide is your complete reference manual to all the functionality provide * [Returning URLs][reverse] * [Exceptions][exceptions] * [Status codes][status] +* [Testing][testing] * [Settings][settings] ## Topics @@ -288,6 +289,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. [reverse]: api-guide/reverse.md [exceptions]: api-guide/exceptions.md [status]: api-guide/status-codes.md +[testing]: api-guide/testing.md [settings]: api-guide/settings.md [documenting-your-api]: topics/documenting-your-api.md diff --git a/docs/template.html b/docs/template.html index 27bc1062..a20c8111 100644 --- a/docs/template.html +++ b/docs/template.html @@ -89,6 +89,7 @@ <li><a href="{{ base_url }}/api-guide/reverse{{ suffix }}">Returning URLs</a></li> <li><a href="{{ base_url }}/api-guide/exceptions{{ suffix }}">Exceptions</a></li> <li><a href="{{ base_url }}/api-guide/status-codes{{ suffix }}">Status codes</a></li> + <li><a href="{{ base_url }}/api-guide/testing{{ suffix }}">Testing</a></li> <li><a href="{{ base_url }}/api-guide/settings{{ suffix }}">Settings</a></li> </ul> </li> diff --git a/docs/topics/credits.md b/docs/topics/credits.md index 1b34d5e0..e9b60074 100644 --- a/docs/topics/credits.md +++ b/docs/topics/credits.md @@ -157,6 +157,7 @@ The following people have helped make REST framework great. * Dan Stephenson - [etos] * Martin Clement - [martync] * Jeremy Satterfield - [jsatt] +* Christopher Paolini - [chrispaolini] Many thanks to everyone who's contributed to the project. @@ -350,3 +351,4 @@ You can also contact [@_tomchristie][twitter] directly on twitter. [etos]: https://github.com/etos [martync]: https://github.com/martync [jsatt]: https://github.com/jsatt +[chrispaolini]: https://github.com/chrispaolini diff --git a/docs/topics/release-notes.md b/docs/topics/release-notes.md index 876f46d8..52abfc08 100644 --- a/docs/topics/release-notes.md +++ b/docs/topics/release-notes.md @@ -40,12 +40,18 @@ You can determine your currently installed version using `pip freeze`: ## 2.3.x series -### master +### Master + +* Support customizable view name and description functions, using the `VIEW_NAME_FUNCTION` and `VIEW_DESCRIPTION_FUNCTION` settings. + +### 2.3.7 + +**Date**: 16th August 2013 * Added `APITestClient`, `APIRequestFactory` and `APITestCase` etc... * Refactor `SessionAuthentication` to allow esier override for CSRF exemption. -* Remove 'Hold down "Control" message from help_text". -* Added admin configuration for tokens. +* Remove 'Hold down "Control" message from help_text' widget messaging when not appropriate. +* Added admin configuration for auth tokens. * Bugfix: `AnonRateThrottle` fixed to not throttle authenticated users. * Bugfix: Don't set `X-Throttle-Wait-Seconds` when throttle does not have `wait` value. * Bugfix: Fixed `PATCH` button title in browsable API. |
