routes.py 466 B

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