Пример #1
0
def insert_job(sess,
               filetype,
               status,
               type_id,
               submission,
               job_id=None,
               filename=None,
               original_filename=None,
               file_size=None,
               num_rows=None,
               num_valid_rows=0,
               num_errors=0,
               updated_at=None):
    """Insert one job into job tracker and get ID back."""
    if not updated_at:
        updated_at = datetime.utcnow()

    job = Job(created_at=datetime.utcnow(),
              updated_at=updated_at,
              file_type_id=filetype,
              job_status_id=status,
              job_type_id=type_id,
              submission_id=submission,
              filename=filename,
              original_filename=original_filename,
              file_size=file_size,
              number_of_rows=num_rows,
              number_of_rows_valid=num_valid_rows,
              number_of_errors=num_errors)
    if job_id:
        job.job_id = job_id
    sess.add(job)
    sess.commit()
    return job
def insert_job(sess,
               filetype,
               status,
               type_id,
               submission,
               job_id=None,
               filename=None,
               original_filename=None,
               file_size=None,
               num_rows=None,
               num_errors=0):
    """Insert one job into job tracker and get ID back."""
    job = Job(file_type_id=filetype,
              job_status_id=status,
              job_type_id=type_id,
              submission_id=submission,
              filename=filename,
              original_filename=original_filename,
              file_size=file_size,
              number_of_rows=num_rows,
              number_of_errors=num_errors)
    if job_id:
        job.job_id = job_id
    sess.add(job)
    sess.commit()
    return job
Пример #3
0
 def insertJob(jobTracker, filetype, status, type_id, submission, job_id=None, filename = None, file_size = None, num_rows = None):
     """Insert one job into job tracker and get ID back."""
     job = Job(
         file_type_id=filetype,
         job_status_id=status,
         job_type_id=type_id,
         submission_id=submission,
         original_filename=filename,
         file_size = file_size,
         number_of_rows = num_rows
     )
     if job_id:
         job.job_id = job_id
     jobTracker.session.add(job)
     jobTracker.session.commit()
     return job.job_id
def insert_job(sess, filetype, status, type_id, submission, job_id=None, filename=None, original_filename=None,
               file_size=None, num_rows=None, num_errors=0):
    """Insert one job into job tracker and get ID back."""
    job = Job(
        file_type_id=filetype,
        job_status_id=status,
        job_type_id=type_id,
        submission_id=submission,
        filename=filename,
        original_filename=original_filename,
        file_size=file_size,
        number_of_rows=num_rows,
        number_of_errors=num_errors
    )
    if job_id:
        job.job_id = job_id
    sess.add(job)
    sess.commit()
    return job
Пример #5
0
 def insertJob(jobTracker,
               filetype,
               status,
               type_id,
               submission,
               job_id=None,
               filename=None,
               file_size=None,
               num_rows=None):
     """Insert one job into job tracker and get ID back."""
     job = Job(file_type_id=filetype,
               job_status_id=status,
               job_type_id=type_id,
               submission_id=submission,
               original_filename=filename,
               file_size=file_size,
               number_of_rows=num_rows)
     if job_id:
         job.job_id = job_id
     jobTracker.session.add(job)
     jobTracker.session.commit()
     return job.job_id