  
          return reverse(url_name, *args, **kwargs)
  
  
  class ViewSet(ViewSetMixin, views.APIView):
      """
      The base ViewSet class does not provide any actions by default.
      """
      pass
 
</s> remove         Set the `.action` attribute on the view,
        depending on the request method.
 </s> add         Set the `.action` attribute on the view, depending on the request method. </s> remove     Ensure `@detail_route` decorator raises an except when applied
 </s> add     Ensure `@action` decorator raises an except when applied </s> remove     methods = ['get'] if (methods is None) else methods

    def decorator(func):
        func.bind_to_methods = methods
        func.detail = False
        func.kwargs = kwargs
        return func
    return decorator
 </s> add     warnings.warn(
        "`list_route` is pending deprecation and will be removed in 3.10 in favor of "
        "`action`, which accepts a `detail` bool. Use `@action(detail=False)` instead.",
        PendingDeprecationWarning, stacklevel=2
    )
    return action(methods, detail=False, **kwargs)
    @classmethod
    def get_extra_actions(cls):
        """
        Get the methods that are marked as an extra ViewSet `@action`.
        """
        return [method for _, method in getmembers(cls, _is_extra_action)]

  
          return reverse(url_name, *args, **kwargs)
  
    @classmethod
    def get_extra_actions(cls):
        """
        Get the methods that are marked as an extra ViewSet `@action`.
        """
        return [method for _, method in getmembers(cls, _is_extra_action)]

  
  class ViewSet(ViewSetMixin, views.APIView):
      """
      The base ViewSet class does not provide any actions by default.
      """
      pass
keep keep add keep keep keep keep keep keep
 Rework dynamic list/detail actions (#5705)

* Merge list/detail route decorators into 'action'

* Merge dynamic routes, add 'detail' attribute

* Add 'ViewSet.get_extra_actions()'

* Refactor dynamic route checking & collection

* Refactor dynamic route generation

* Add 'ViewSet.detail' initkwarg

* Fixup schema test

* Add release notes for dynamic action changes

* Replace list/detail route decorators in tests

* Convert tabs to spaces in router docs

* Update docs

* Make 'detail' a required argument of 'action'

* Improve router docs 
rest_framework/viewsets.py