8000 Commenting · dhepper/django-rest-framework@9e24db0 · GitHub
[go: up one dir, main page]

Skip to content

Commit 9e24db0

Browse files
committed
Commenting
1 parent fb41d2a commit 9e24db0

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

rest_framework/routers.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class DefaultRouter(BaseRouter):
2929
def get_urlpatterns(self):
3030
ret = []
3131
for prefix, viewset, base_name in self.registry:
32-
# Bind standard routes
32+
# Bind standard CRUD routes
3333
for suffix, action_mapping, name_format in self.route_list:
3434

3535
# Only actions which actually exist on the viewset will be bound
@@ -44,10 +44,12 @@ def get_urlpatterns(self):
4444
name = name_format % base_name
4545
ret.append(url(regex, view, name=name))
4646

47-
# Bind any extra @action or @link routes
47+
# Bind any extra `@action` or `@link` routes
4848
for attr in dir(viewset):
4949
func = getattr(viewset, attr)
5050
http_method = getattr(func, 'bind_to_method', None)
51+
52+
# Skip if this is not an @action or @link method
5153
if not http_method:
5254
continue
5355

0 commit comments

Comments
 (0)
0