Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
django-rest-framework
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
django-rest-framework
Commits
9e24db02
Commit
9e24db02
authored
Apr 04, 2013
by
Tom Christie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Commenting
parent
fb41d2ac
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
rest_framework/routers.py
+4
-2
No files found.
rest_framework/routers.py
View file @
9e24db02
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment