routes.py 403 B

1234567891011121314151617
  1. import copy
  2. from rest_framework.routers import DefaultRouter, SimpleRouter
  3. __all__ = ["BulkRouter"]
  4. class BulkRouter(DefaultRouter):
  5. """
  6. Map http methods to actions defined on the bulk mixins.
  7. """
  8. routes = copy.deepcopy(SimpleRouter.routes)
  9. routes[0].mapping.update({
  10. 'put': 'bulk_update',
  11. 'patch': 'partial_bulk_update',
  12. 'delete': 'bulk_destroy',
  13. })