mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-08-02 19:40:13 +03:00
Update routers.py
modified generate route, now is looks more like restful route mode.
This commit is contained in:
parent
7123f0b1e6
commit
a1601c1d66
|
@ -72,7 +72,7 @@ class SimpleRouter(BaseRouter):
|
||||||
routes = [
|
routes = [
|
||||||
# List route.
|
# List route.
|
||||||
Route(
|
Route(
|
||||||
url=r'^{prefix}/$',
|
url=r'^{prefix}$',
|
||||||
mapping={
|
mapping={
|
||||||
'get': 'list',
|
'get': 'list',
|
||||||
'post': 'create'
|
'post': 'create'
|
||||||
|
@ -82,7 +82,7 @@ class SimpleRouter(BaseRouter):
|
||||||
),
|
),
|
||||||
# Detail route.
|
# Detail route.
|
||||||
Route(
|
Route(
|
||||||
url=r'^{prefix}/{lookup}/$',
|
url=r'^{prefix}/{lookup}$',
|
||||||
mapping={
|
mapping={
|
||||||
'get': 'retrieve',
|
'get': 'retrieve',
|
||||||
'put': 'update',
|
'put': 'update',
|
||||||
|
@ -95,7 +95,7 @@ class SimpleRouter(BaseRouter):
|
||||||
# Dynamically generated routes.
|
# Dynamically generated routes.
|
||||||
# Generated using @action or @link decorators on methods of the viewset.
|
# Generated using @action or @link decorators on methods of the viewset.
|
||||||
Route(
|
Route(
|
||||||
url=r'^{prefix}/{lookup}/{methodname}/$',
|
url=r'^{prefix}/{lookup}/{methodname}$',
|
||||||
mapping={
|
mapping={
|
||||||
'{httpmethod}': '{methodname}',
|
'{httpmethod}': '{methodname}',
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue
Block a user