diff options
| author | Alex Burgel | 2013-06-06 11:51:52 -0400 | 
|---|---|---|
| committer | Alex Burgel | 2013-07-15 17:59:36 -0400 | 
| commit | 57cf8b5fa4f62f9b58912f10536a7ae5076ce54c (patch) | |
| tree | a4150df13fb3024682dded6345c7e1ab1813b323 /docs/api-guide/viewsets.md | |
| parent | 5b11e23f6fb35834057fba35832a597ce443cc77 (diff) | |
| download | django-rest-framework-57cf8b5fa4f62f9b58912f10536a7ae5076ce54c.tar.bz2 | |
Rework extra routes doc for better readability
Diffstat (limited to 'docs/api-guide/viewsets.md')
| -rw-r--r-- | docs/api-guide/viewsets.md | 4 | 
1 files changed, 2 insertions, 2 deletions
| diff --git a/docs/api-guide/viewsets.md b/docs/api-guide/viewsets.md index 9fa6615b..e83487fb 100644 --- a/docs/api-guide/viewsets.md +++ b/docs/api-guide/viewsets.md @@ -92,7 +92,7 @@ The default routers included with REST framework will provide routes for a stand          def destroy(self, request, pk=None):              pass -If you have ad-hoc methods that you need to be routed to, you can mark them as requiring routing using the `@collection_link`, `@collection_action`, `@link`, or `@action` decorators.  The `@collection_link` and `@link` decorator will route `GET` requests, and the `@collection_action` and `@action` decorator will route `POST` requests. +If you have ad-hoc methods that you need to be routed to, you can mark them as requiring routing using the `@link`, `@action`, `@collection_link`, or `@collection_action` decorators.  The `@link` and `@collection_link` decorators will route `GET` requests, and the `@action` and `@collection_action` decorators will route `POST` requests.  The `@link` and `@action` decorators contain `pk` in their URL pattern and are intended for methods which require a single instance. The `@collection_link` and `@collection_action` decorators are intended for methods which operate on a collection of objects. @@ -136,7 +136,7 @@ The decorators can additionally take extra arguments that will be set for the ro          def set_password(self, request, pk=None):             ... -The `@collection_action` and `@action` decorators will route `POST` requests by default, but may also accept other HTTP methods, by using the `method` argument.  For example: +The `@action` and `@collection_action` decorators will route `POST` requests by default, but may also accept other HTTP methods, by using the `methods` argument.  For example:          @action(methods=['POST', 'DELETE'])          def unset_password(self, request, pk=None): | 
