@blueprint.route('/completed_jobs.json', methods=['GET'])
def completed_jobs():
 completed_datasets = get_job_list(dataset.DatasetJob, False)
 completed_models = get_job_list(model.ModelJob, False)
 running_datasets = get_job_list(dataset.DatasetJob, True)
 running_models = get_job_list(model.ModelJob, True)
 pretrained_models = get_job_list(pretrained_model.PretrainedModelJob, False)
 model_output_fields = set()
 data = {'running': [json_dict(j, model_output_fields) for j in (running_datasets + running_models)], 'datasets': [json_dict(j, model_output_fields) for j in completed_datasets], 'models': [json_dict(j, model_output_fields) for j in completed_models], 'pretrained_models': [json_dict(j, model_output_fields) for j in pretrained_models], 'model_output_fields': sorted(list(model_output_fields))}
 return flask.jsonify(data)

@ blueprint . route ( '/completed_jobs.json' , methods = [ 'GET' ] ) def completed_jobs ( ) : completed_datasets = get_job_list ( dataset . DatasetJob , False ) completed_models = get_job_list ( model . ModelJob , False ) running_datasets = get_job_list ( dataset . DatasetJob , True ) running_models = get_job_list ( model . ModelJob , True ) pretrained_models = get_job_list ( pretrained_model . PretrainedModelJob , False ) model_output_fields = set ( ) data = { 'running' : [ json_dict ( j , model_output_fields ) for j in ( running_datasets + running_models ) ] , 'datasets' : [ json_dict ( j , model_output_fields ) for j in completed_datasets ] , 'models' : [ json_dict ( j , model_output_fields ) for j in completed_models ] , 'pretrained_models' : [ json_dict ( j , model_output_fields ) for j in pretrained_models ] , 'model_output_fields' : sorted ( list ( model_output_fields ) ) } return flask . jsonify ( data )
returns json datasets: [{id .