Skip to content

router#

CommonRouter#

Bases: DefaultRouter

Source code in src/apps/router/router.py
class CommonRouter(DefaultRouter):
    def __init__(self, *args, **kwargs):
        """
        Add additional route to method mappings.
        """
        super().__init__(*args, **kwargs)

        # List route is in self.routes[0]
        self.routes[0].mapping["delete"] = "destroy_list"

__init__(*args, **kwargs) #

Add additional route to method mappings.

Source code in src/apps/router/router.py
def __init__(self, *args, **kwargs):
    """
    Add additional route to method mappings.
    """
    super().__init__(*args, **kwargs)

    # List route is in self.routes[0]
    self.routes[0].mapping["delete"] = "destroy_list"