diff options
| author | Xavier Ordoquy | 2015-01-10 10:41:12 +0100 |
|---|---|---|
| committer | Xavier Ordoquy | 2015-01-10 10:41:12 +0100 |
| commit | d8dbd8679080035de4e785a8e7b998fb01f4052b (patch) | |
| tree | baceae881ed53e5a25295367f6a58bb6fe1c131e /tutorial/6-viewsets-and-routers/index.html | |
| parent | c1e4ec0c64933da5411e4cc3e63894d5f82cc337 (diff) | |
| download | django-rest-framework-d8dbd8679080035de4e785a8e7b998fb01f4052b.tar.bz2 | |
Update documentation
Diffstat (limited to 'tutorial/6-viewsets-and-routers/index.html')
| -rw-r--r-- | tutorial/6-viewsets-and-routers/index.html | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/tutorial/6-viewsets-and-routers/index.html b/tutorial/6-viewsets-and-routers/index.html index 4babe707..254ab791 100644 --- a/tutorial/6-viewsets-and-routers/index.html +++ b/tutorial/6-viewsets-and-routers/index.html @@ -437,6 +437,7 @@ class SnippetViewSet(viewsets.ModelViewSet): <p>This time we've used the <code>ModelViewSet</code> class in order to get the complete set of default read and write operations.</p> <p>Notice that we've also used the <code>@detail_route</code> decorator to create a custom action, named <code>highlight</code>. This decorator can be used to add any custom endpoints that don't fit into the standard <code>create</code>/<code>update</code>/<code>delete</code> style.</p> <p>Custom actions which use the <code>@detail_route</code> decorator will respond to <code>GET</code> requests. We can use the <code>methods</code> argument if we wanted an action that responded to <code>POST</code> requests.</p> +<p>The URLs for custom actions by default depend on the method name itself. If you want to change the way url should be constructed, you can include url_path as a decorator keyword argument.</p> <h2 id="binding-viewsets-to-urls-explicitly">Binding ViewSets to URLs explicitly</h2> <p>The handler methods only get bound to the actions when we define the URLConf. To see what's going on under the hood let's first explicitly create a set of views from our ViewSets.</p> |
