コード例 #1
0
def upload_cover_upload(request, upload_id):
    book_upload = BookUpload.objects.only('cover_url', 'cover_data').get(id=upload_id)
    if not book_upload.cover_url:
        whatimg_url = whatimg.upload_image_from_memory(book_upload.cover_data)
        book_upload.cover_url = whatimg_url
        book_upload.save()
    return redirect('books.views.edit_upload', upload_id)
コード例 #2
0
ファイル: views.py プロジェクト: karamanolev/WhatManager2
def upload_cover_to_whatimg(request, upload_id):
    qobuz_upload = QobuzUpload.objects.get(id=upload_id)
    with open(os.path.join(wm_str(qobuz_upload.temp_media_path), 'folder.jpg'), 'rb') as f:
        data = f.read()
    qobuz_upload.what_img_cover = whatimg.upload_image_from_memory('4460', data)
    qobuz_upload.save()
    return redirect(edit_upload, upload_id)
コード例 #3
0
ファイル: views.py プロジェクト: point-source/WhatManager2
def upload_cover_to_whatimg(request, upload_id):
    qobuz_upload = QobuzUpload.objects.get(id=upload_id)
    with open(os.path.join(wm_str(qobuz_upload.temp_media_path), 'folder.jpg'),
              'rb') as f:
        data = f.read()
    qobuz_upload.what_img_cover = whatimg.upload_image_from_memory(
        '4460', data)
    qobuz_upload.save()
    return redirect(edit_upload, upload_id)