urls.py 546 B

12345678910111213141516
  1. from django.urls import path, re_path
  2. from . import views
  3. urlpatterns = [
  4. path(r'', views.APIViewSet.as_view({"get": "list", "post": "create"}), name="warehouse"),
  5. re_path(r'^(?P<pk>\d+)/$', views.APIViewSet.as_view({
  6. 'get': 'retrieve',
  7. 'put': 'update',
  8. 'patch': 'partial_update',
  9. 'delete': 'destroy'
  10. }), name="warehouse_1"),
  11. path(r'multiple/', views.MultipleViewSet.as_view({"get": "list"}), name="warehouse"),
  12. re_path(r'^multiple/(?P<pk>\d+)/$', views.MultipleViewSet.as_view({
  13. 'get': 'retrieve',
  14. }), name="warehouse_1")
  15. ]