def get_jobs(not_yet_run=False, running=False, finished=False, **filter_data):
 filter_data['extra_args'] = rpc_utils.extra_job_filters(not_yet_run, running, finished)
 job_dicts = []
 jobs = list(models.Job.query_objects(filter_data))
 models.Job.objects.populate_relationships(jobs, models.Label, 'dependencies')
 models.Job.objects.populate_relationships(jobs, models.JobKeyval, 'keyvals')
 for job in jobs:
  job_dict = job.get_object_dict()
  job_dict['dependencies'] = ','.join((label.name for label in job.dependencies))
  job_dict['keyvals'] = dict(((keyval.key, keyval.value) for keyval in job.keyvals))
  job_dicts.append(job_dict)
 return rpc_utils.prepare_for_serialization(job_dicts)

def get_jobs ( not_yet_run = False , running = False , finished = False , ** filter_data ) : filter_data [ 'extra_args' ] = rpc_utils . extra_job_filters ( not_yet_run , running , finished ) job_dicts = [ ] jobs = list ( models . Job . query_objects ( filter_data ) ) models . Job . objects . populate_relationships ( jobs , models . Label , 'dependencies' ) models . Job . objects . populate_relationships ( jobs , models . JobKeyval , 'keyvals' ) for job in jobs : job_dict = job . get_object_dict ( ) job_dict [ 'dependencies' ] = ',' . join ( ( label . name for label in job . dependencies ) ) job_dict [ 'keyvals' ] = dict ( ( ( keyval . key , keyval . value ) for keyval in job . keyvals ) ) job_dicts . append ( job_dict ) return rpc_utils . prepare_for_serialization ( job_dicts )
extra filter args for get_jobs: -not_yet_run: include only jobs that have not yet started running .