aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortanwanirahul2014-12-19 19:52:59 +0530
committertanwanirahul2014-12-19 19:52:59 +0530
commit92ebeaa040f75dbc6142355fa25d89b4c990685b (patch)
tree7298baf826fd8b62dffa0bbc8604f13a5659e119
parent6a095e91109755927aeeed1c81cf7b80ff326af4 (diff)
downloaddjango-rest-framework-92ebeaa040f75dbc6142355fa25d89b4c990685b.tar.bz2
Change decorator attribute name to url_path per suggestions
-rw-r--r--rest_framework/routers.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/rest_framework/routers.py b/rest_framework/routers.py
index d1c9fa1b..a213f62c 100644
--- a/rest_framework/routers.py
+++ b/rest_framework/routers.py
@@ -177,26 +177,26 @@ class SimpleRouter(BaseRouter):
# Dynamic detail routes (@detail_route decorator)
for httpmethods, methodname in detail_routes:
method_kwargs = getattr(viewset, methodname).kwargs
- custom_method_name = method_kwargs.pop("custom_method_name", None) or methodname
+ url_path = method_kwargs.pop("url_path", None) or methodname
initkwargs = route.initkwargs.copy()
initkwargs.update(method_kwargs)
ret.append(Route(
- url=replace_methodname(route.url, custom_method_name),
+ url=replace_methodname(route.url, url_path),
mapping=dict((httpmethod, methodname) for httpmethod in httpmethods),
- name=replace_methodname(route.name, custom_method_name),
+ name=replace_methodname(route.name, url_path),
initkwargs=initkwargs,
))
elif isinstance(route, DynamicListRoute):
# Dynamic list routes (@list_route decorator)
for httpmethods, methodname in list_routes:
method_kwargs = getattr(viewset, methodname).kwargs
- custom_method_name = method_kwargs.pop("custom_method_name", None) or methodname
+ url_path = method_kwargs.pop("url_path", None) or methodname
initkwargs = route.initkwargs.copy()
initkwargs.update(method_kwargs)
ret.append(Route(
- url=replace_methodname(route.url, custom_method_name),
+ url=replace_methodname(route.url, url_path),
mapping=dict((httpmethod, methodname) for httpmethod in httpmethods),
- name=replace_methodname(route.name, custom_method_name),
+ name=replace_methodname(route.name, url_path),
initkwargs=initkwargs,
))
else: