def detail_route(methods=None, **kwargs):
 methods = ([u'get'] if (methods is None) else methods)
 def decorator(func):
  func.bind_to_methods = methods
  func.detail = True
  func.kwargs = kwargs
  return func
 return decorator

def detail_route ( methods = None , ** kwargs ) : methods = ( [ u'get' ] if ( methods is None ) else methods ) def decorator ( func ) : func . bind_to_methods = methods func . detail = True func . kwargs = kwargs return func return decorator
used to mark a method on a viewset that should be routed for detail requests .