mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-11-22 09:36:49 +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}$',
|
||||
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(
|
||||
|
|
Loading…
Reference in New Issue
Block a user