aboutsummaryrefslogtreecommitdiffstats
path: root/rest_framework/routers.py
diff options
context:
space:
mode:
authorTom Christie2013-05-14 11:34:47 +0100
committerTom Christie2013-05-14 11:34:47 +0100
commitce1a04a603cac28fc3332151623f3831ec5f4660 (patch)
tree64199dfa68067ac5329931f49a0cda9ccfb7f03b /rest_framework/routers.py
parent2cff6e69dbe3828eca56d0ce60ffdfc80fed045c (diff)
parent5e2d8052d4bf87c81cc9807c96c933ca975cc483 (diff)
downloaddjango-rest-framework-ce1a04a603cac28fc3332151623f3831ec5f4660.tar.bz2
Merge branch 'master' of https://github.com/avinash240/django-rest-framework
Diffstat (limited to 'rest_framework/routers.py')
-rw-r--r--rest_framework/routers.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/rest_framework/routers.py b/rest_framework/routers.py
index ed4dc338..76714fd0 100644
--- a/rest_framework/routers.py
+++ b/rest_framework/routers.py
@@ -127,18 +127,18 @@ class SimpleRouter(BaseRouter):
"""
# Determine any `@action` or `@link` decorated methods on the viewset
- dynamic_routes = {}
+ dynamic_routes = []
for methodname in dir(viewset):
attr = getattr(viewset, methodname)
httpmethod = getattr(attr, 'bind_to_method', None)
if httpmethod:
- dynamic_routes[httpmethod] = methodname
+ dynamic_routes.append((httpmethod, methodname))
ret = []
for route in self.routes:
if route.mapping == {'{httpmethod}': '{methodname}'}:
# Dynamic routes (@link or @action decorator)
- for httpmethod, methodname in dynamic_routes.items():
+ for httpmethod, methodname in dynamic_routes:
initkwargs = route.initkwargs.copy()
initkwargs.update(getattr(viewset, methodname).kwargs)
ret.append(Route(