def create_export_job(task_id, event_id):
 export_job = ExportJob.query.filter_by(event_id=event_id).first()
 task_url = url_for('api.extras_celery_task', task_id=task_id)
 if export_job:
  export_job.task = task_url
  export_job.user_email = g.user.email
  export_job.event = EventModel.query.get(event_id)
  export_job.start_time = datetime.now()
 else:
  export_job = ExportJob(task=task_url, user_email=g.user.email, event=EventModel.query.get(event_id))
 save_to_db(export_job, 'ExportJob saved')

def create_export_job ( task_id , event_id ) : export_job = ExportJob . query . filter_by ( event_id = event_id ) . first ( ) task_url = url_for ( 'api.extras_celery_task' , task_id = task_id ) if export_job : export_job . task = task_url export_job . user_email = g . user . email export_job . event = EventModel . query . get ( event_id ) export_job . start_time = datetime . now ( ) else : export_job = ExportJob ( task = task_url , user_email = g . user . email , event = EventModel . query . get ( event_id ) ) save_to_db ( export_job , 'ExportJob saved' )
create export job for an export that is going to start .