# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from __future__ import absolute_import
from rest_framework_bulk.routes import BulkRouter
from rest_framework_nested.routers import NestedSimpleRouter


__all__ = ('BulkRouter', 'BulkNestedRouter')


# Map of HTTP verbs to rest_framework_bulk operations.
BULK_OPERATIONS_MAP = {
    'put': 'bulk_update',
    'patch': 'partial_bulk_update',
    'delete': 'bulk_destroy',
}


class BulkNestedRouter(NestedSimpleRouter):
    """
    Bulk-enabled nested router.
    """
    def __init__(self, *args, **kwargs):
        super(BulkNestedRouter, self).__init__(*args, **kwargs)
        self.routes[0].mapping.update(BULK_OPERATIONS_MAP)

# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from __future__ import absolute_import
from rest_framework_bulk.routes import BulkRouter
from rest_framework_nested.routers import NestedSimpleRouter


__all__ = ('BulkRouter', 'BulkNestedRouter')


# Map of HTTP verbs to rest_framework_bulk operations.
BULK_OPERATIONS_MAP = {
    'put': 'bulk_update',
    'patch': 'partial_bulk_update',
    'delete': 'bulk_destroy',
}


class BulkNestedRouter(NestedSimpleRouter):
    """
    Bulk-enabled nested router.
    """
    def __init__(self, *args, **kwargs):
        super(BulkNestedRouter, self).__init__(*args, **kwargs)
        self.routes[0].mapping.update(BULK_OPERATIONS_MAP)

# -*- coding: utf-8 -*- # Map of HTTP verbs to rest_framework_bulk operations. Bulk-enabled nested router.