Skip to content

Commit

Permalink
Docs: Add missing argument 'detail' to Route (encode#5920)
Browse files Browse the repository at this point in the history
The namedtuple Route requires `detail` to be specified, otherwise it
fails with:
`TypeError: __new__() missing 1 required positional argument: 'detail'`

See https://github.com/encode/django-rest-framework/pull/5705/files#diff-88b0cad65f9e1caad64e0c9bb44615f9R34
  • Loading branch information
michael-k authored and Pierre Chiquet committed Mar 24, 2020
1 parent 038a552 commit 965ba91
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions docs/api-guide/routers.md
Original file line number Diff line number Diff line change
Expand Up @@ -241,12 +241,14 @@ The following example will only route to the `list` and `retrieve` actions, and
url=r'^{prefix}$',
mapping={'get': 'list'},
name='{basename}-list',
detail=False,
initkwargs={'suffix': 'List'}
),
Route(
url=r'^{prefix}/{lookup}$',
mapping={'get': 'retrieve'},
name='{basename}-detail',
detail=True,
initkwargs={'suffix': 'Detail'}
),
DynamicRoute(
Expand Down

0 comments on commit 965ba91

Please sign in to comment.