aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTom Christie2013-04-04 20:38:42 +0100
committerTom Christie2013-04-04 20:38:42 +0100
commit9e24db022cd8da1a588dd43e6239e07798881c02 (patch)
tree63e3ec929836fd5825f7b41863bd17040bb44471
parentfb41d2ac8f495ae0728e3f38c6a21306f0507316 (diff)
downloaddjango-rest-framework-9e24db022cd8da1a588dd43e6239e07798881c02.tar.bz2
Commenting
-rw-r--r--rest_framework/routers.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/rest_framework/routers.py b/rest_framework/routers.py
index d1e96156..283add8d 100644
--- a/rest_framework/routers.py
+++ b/rest_framework/routers.py
@@ -29,7 +29,7 @@ class DefaultRouter(BaseRouter):
def get_urlpatterns(self):
ret = []
for prefix, viewset, base_name in self.registry:
- # Bind standard routes
+ # Bind standard CRUD routes
for suffix, action_mapping, name_format in self.route_list:
# Only actions which actually exist on the viewset will be bound
@@ -44,10 +44,12 @@ class DefaultRouter(BaseRouter):
name = name_format % base_name
ret.append(url(regex, view, name=name))
- # Bind any extra @action or @link routes
+ # Bind any extra `@action` or `@link` routes
for attr in dir(viewset):
func = getattr(viewset, attr)
http_method = getattr(func, 'bind_to_method', None)
+
+ # Skip if this is not an @action or @link method
if not http_method:
continue