Skip to content

Commit a8a3fed

Browse files
committed
Add url_path documention for detail_route decorator
1 parent 2448cc8 commit a8a3fed

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

docs/tutorial/6-viewsets-and-routers.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ Notice that we've also used the `@detail_route` decorator to create a custom act
5353

5454
Custom actions which use the `@detail_route` decorator will respond to `GET` requests. We can use the `methods` argument if we wanted an action that responded to `POST` requests.
5555

56+
The URLs for custom actions by default depends on the method name itself. If you want to change the way url should be constructed, you can use `url_path` parameter of `@detail_route` and provide the string value for the same.
57+
5658
## Binding ViewSets to URLs explicitly
5759

5860
The handler methods only get bound to the actions when we define the URLConf.

0 commit comments

Comments
 (0)