routes.py 459 B

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