Skip to content

Commit ffac61c

Browse files
michael-kcarltongibson
authored andcommitted
Docs: Add missing argument 'detail' to Route (#5920)
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
1 parent bc35345 commit ffac61c

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

docs/api-guide/routers.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,12 +241,14 @@ The following example will only route to the `list` and `retrieve` actions, and
241241
url=r'^{prefix}$',
242242
mapping={'get': 'list'},
243243
name='{basename}-list',
244+
detail=False,
244245
initkwargs={'suffix': 'List'}
245246
),
246247
Route(
247248
url=r'^{prefix}/{lookup}$',
248249
mapping={'get': 'retrieve'},
249250
name='{basename}-detail',
251+
detail=True,
250252
initkwargs={'suffix': 'Detail'}
251253
),
252254
DynamicRoute(

0 commit comments

Comments
 (0)