mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-08-05 04:50:12 +03:00
Parametrizable viewset custom views reverse name
This commit is contained in:
parent
06a5bcc88e
commit
b4e70dfdbf
|
@ -179,10 +179,11 @@ class SimpleRouter(BaseRouter):
|
|||
initkwargs = route.initkwargs.copy()
|
||||
initkwargs.update(method_kwargs)
|
||||
url_path = initkwargs.pop("url_path", None) or methodname
|
||||
url_name = initkwargs.pop("url_name", None) or url_path
|
||||
ret.append(Route(
|
||||
url=replace_methodname(route.url, url_path),
|
||||
mapping={httpmethod: methodname for httpmethod in httpmethods},
|
||||
name=replace_methodname(route.name, url_path),
|
||||
name=replace_methodname(route.name, url_name),
|
||||
initkwargs=initkwargs,
|
||||
))
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user