@login_required
@ensure_csrf_cookie
@require_http_methods(('GET', 'POST'))
def library_handler(request, library_key_string=None):
 if (not LIBRARIES_ENABLED):
  log.exception('Attempted to use the content library API when the libraries feature is disabled.')
  raise Http404
 if ((library_key_string is not None) and (request.method == 'POST')):
  return HttpResponseNotAllowed(('POST',))
 if (request.method == 'POST'):
  return _create_library(request)
 if library_key_string:
  return _display_library(library_key_string, request)
 return _list_libraries(request)

@ login_required @ ensure_csrf_cookie @ require_http_methods ( ( 'GET' , 'POST' ) ) def library_handler ( request , library_key_string = None ) : if ( not LIBRARIES_ENABLED ) : log . exception ( 'Attempted to use the content library API when the libraries feature is disabled.' ) raise Http404 if ( ( library_key_string is not None ) and ( request . method == 'POST' ) ) : return HttpResponseNotAllowed ( ( 'POST' , ) ) if ( request . method == 'POST' ) : return _create_library ( request ) if library_key_string : return _display_library ( library_key_string , request ) return _list_libraries ( request )
restful interface to most content library related functionality .