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
This commit is contained in:
Michael 2018-04-05 12:24:31 +00:00 committed by Carlton Gibson
parent bc353452f4
commit ffac61c6fe

View File

@ -241,12 +241,14 @@ The following example will only route to the `list` and `retrieve` actions, and
url=r'^{prefix}$', url=r'^{prefix}$',
mapping={'get': 'list'}, mapping={'get': 'list'},
name='{basename}-list', name='{basename}-list',
detail=False,
initkwargs={'suffix': 'List'} initkwargs={'suffix': 'List'}
), ),
Route( Route(
url=r'^{prefix}/{lookup}$', url=r'^{prefix}/{lookup}$',
mapping={'get': 'retrieve'}, mapping={'get': 'retrieve'},
name='{basename}-detail', name='{basename}-detail',
detail=True,
initkwargs={'suffix': 'Detail'} initkwargs={'suffix': 'Detail'}
), ),
DynamicRoute( DynamicRoute(