mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-11-26 03:23:59 +03:00
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:
parent
bc353452f4
commit
ffac61c6fe
|
@ -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(
|
||||||
|
|
Loading…
Reference in New Issue
Block a user