mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-08-05 13:00:12 +03:00
Merge remote-tracking branch 'origin/master'
# Conflicts: # rest_framework/routers.py
This commit is contained in:
commit
e59e2c4cca
|
@ -96,13 +96,13 @@ class SimpleRouter(BaseRouter):
|
|||
# Generated using @list_route decorator
|
||||
# on methods of the viewset.
|
||||
DynamicListRoute(
|
||||
url=r'^{prefix}/{methodname}{trailing_slash}$',
|
||||
url=r'^{prefix}{methodname}{trailing_slash}$',
|
||||
name='{basename}-{methodnamehyphen}',
|
||||
initkwargs={}
|
||||
),
|
||||
# Detail route.
|
||||
Route(
|
||||
url=r'^{prefix}/{lookup}{trailing_slash}$',
|
||||
url=r'^{prefix}{lookup}{trailing_slash}$',
|
||||
mapping={
|
||||
'get': 'retrieve',
|
||||
'put': 'update',
|
||||
|
@ -115,7 +115,7 @@ class SimpleRouter(BaseRouter):
|
|||
# Dynamically generated detail routes.
|
||||
# Generated using @detail_route decorator on methods of the viewset.
|
||||
DynamicDetailRoute(
|
||||
url=r'^{prefix}/{lookup}/{methodname}{trailing_slash}$',
|
||||
url=r'^{prefix}{lookup}/{methodname}{trailing_slash}$',
|
||||
name='{basename}-{methodnamehyphen}',
|
||||
initkwargs={}
|
||||
),
|
||||
|
@ -247,6 +247,9 @@ class SimpleRouter(BaseRouter):
|
|||
continue
|
||||
|
||||
# Build the url pattern
|
||||
if prefix:
|
||||
prefix += "/"
|
||||
|
||||
regex = route.url.format(
|
||||
prefix=prefix,
|
||||
lookup=lookup,
|
||||
|
|
Loading…
Reference in New Issue
Block a user