(request, domain)
return json_response({
        'success': True,
        'download_id': download.download_id,
    })
Gets the download_id for the multimedia zip and sends it to the
    exportDownloadService in download_export.ng.js to begin polling for the
    zip file download.
Gets the download_id for the multimedia zip and sends it to the
    exportDownloadService in download_export.ng.js to begin polling for the
    zip file download.
Gets the download_id for the multimedia zip and sends it to the exportDownloadService in download_export . ng . js to begin polling for the zip file download .
def prepare_form_multimedia(request, domain):
    """Gets the download_id for the multimedia zip and sends it to the
    exportDownloadService in download_export.ng.js to begin polling for the
    zip file download.
    """
    form_or_case = request.POST.get('form_or_case')
    sms_export = json.loads(request.POST.get('sms_export'))
    permissions = ExportsPermissionsManager(form_or_case, domain, request.couch_user)
    permissions.access_download_export_or_404()

    view_helper = DownloadExportViewHelper.get(request, domain, form_or_case, sms_export)
    filter_form_data = json.loads(request.POST.get('form_data'))
    export_specs = json.loads(request.POST.get('exports'))
    try:
        filter_form = view_helper.get_filter_form(filter_form_data)
    except ExportFormValidationException:
        return json_response({
            'error': _("Please check that you've submitted all required filters."),
        })

    export = view_helper.get_export(export_specs[0]['export_id'])
    filters = filter_form.get_export_filters(request, filter_form_data)
    export_es_query = get_export_query(export, filters)

    if media_export_is_too_big(export_es_query):
        return json_response({
            'success': False,
            'error': _("This is too many files to export at once.  "
                       "Please modify your filters to select fewer forms."),
        })

    download = DownloadBase()
    download.set_task(build_form_multimedia_zipfile.delay(
        domain=domain,
        export_id=export.get_id,
        es_filters=filters,
        download_id=download.download_id,
        owner_id=request.couch_user.get_id,
    ))

    return json_response({
        'success': True,
        'download_id': download.download_id,
    })
def prepare_form_multimedia ( request , domain ) : form_or_case = request . POST . get ( 'form_or_case' ) sms_export = json . loads ( request . POST . get ( 'sms_export' ) ) permissions = ExportsPermissionsManager ( form_or_case , domain , request . couch_user ) permissions . access_download_export_or_404 ( ) view_helper = DownloadExportViewHelper . get ( request , domain , form_or_case , sms_export ) filter_form_data = json . loads ( request . POST . get ( 'form_data' ) ) export_specs = json . loads ( request . POST . get ( 'exports' ) ) try : filter_form = view_helper . get_filter_form ( filter_form_data ) except ExportFormValidationException : return json_response ( { 'error' : _ ( "Please check that you've submitted all required filters." ) , } ) export = view_helper . get_export ( export_specs [ 0 ] [ 'export_id' ] ) filters = filter_form . get_export_filters ( request , filter_form_data ) export_es_query = get_export_query ( export , filters ) if media_export_is_too_big ( export_es_query ) : return json_response ( { 'success' : False , 'error' : _ ( "This is too many files to export at once.  " "Please modify your filters to select fewer forms." ) , } ) download = DownloadBase ( ) download . set_task ( build_form_multimedia_zipfile . delay ( domain = domain , export_id = export . get_id , es_filters = filters , download_id = download . download_id , owner_id = request . couch_user . get_id , ) ) return json_response ( { 'success' : True , 'download_id' : download . download_id , } )