diff options
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/api-guide/viewsets.md | 5 | ||||
| -rw-r--r-- | docs/topics/release-notes.md | 1 |
2 files changed, 6 insertions, 0 deletions
diff --git a/docs/api-guide/viewsets.md b/docs/api-guide/viewsets.md index 79364626..2783da98 100644 --- a/docs/api-guide/viewsets.md +++ b/docs/api-guide/viewsets.md @@ -126,6 +126,11 @@ The `@action` and `@link` decorators can additionally take extra arguments that def set_password(self, request, pk=None): ... +The `@action` decorator will route `POST` requests by default, but may also accept other HTTP methods, by using the `method` argument. For example: + + @action(methods=['POST', 'DELETE']) + def unset_password(self, request, pk=None): + ... --- # API Reference diff --git a/docs/topics/release-notes.md b/docs/topics/release-notes.md index 6eb18160..005538ae 100644 --- a/docs/topics/release-notes.md +++ b/docs/topics/release-notes.md @@ -44,6 +44,7 @@ You can determine your currently installed version using `pip freeze`: * Added `get_url` hook to `HyperlinkedIdentityField`. * Serializer field `default` argument may be a callable. +* `@action` decorator now accepts a `methods` argument. * Bugfix: The `lookup_field` option on `HyperlinkedIdentityField` should apply by default to the url field on the serializer. * Bugfix: `HyperlinkedIdentityField` should continue to support `pk_url_kwarg`, `slug_url_kwarg`, `slug_field`, in a pending deprecation state. * Bugfix: Ensure we always return 404 instead of 500 if a lookup field cannot be converted to the correct lookup type. (Eg non-numeric `AutoInteger` pk lookup) |
