def list_route(methods=['get'], **kwargs):
 def decorator(func):
  func.bind_to_methods = methods
  func.detail = False
  func.permission_classes = kwargs.get('permission_classes', [])
  func.kwargs = kwargs
  return func
 return decorator

def list_route ( methods = [ 'get' ] , ** kwargs ) : def decorator ( func ) : func . bind_to_methods = methods func . detail = False func . permission_classes = kwargs . get ( 'permission_classes' , [ ] ) func . kwargs = kwargs return func return decorator
used to mark a method on a viewset that should be routed for list requests .