(doc)
return True
Transfer uploaded file to S3 and queue up message to process PDF.
Transfer uploaded file to S3 and queue up message to process PDF.
Transfer uploaded file to S3 and queue up message to process PDF .
def process_file(doc):
    """Transfer uploaded file to S3 and queue up message to process PDF."""
    key = upload_file_to_s3(doc)
    doc.remote_document = "http://%s.s3.amazonaws.com/%s" % (key.bucket.name, key.name)
    doc.date_stored = datetime.utcnow()
    doc.status = 'S'
    doc.save()

    queue_json_message(doc, key)
    doc.status = 'Q'
    doc.date_queued = datetime.utcnow()
    doc.save()

    return True
def process_file ( doc ) : key = upload_file_to_s3 ( doc ) doc . remote_document = "http://%s.s3.amazonaws.com/%s" % ( key . bucket . name , key . name ) doc . date_stored = datetime . utcnow ( ) doc . status = 'S' doc . save ( ) queue_json_message ( doc , key ) doc . status = 'Q' doc . date_queued = datetime . utcnow ( ) doc . save ( ) return True