interaction_views.py 749 Bytes
Newer Older
1 2 3
from django.shortcuts import render

def MUSE_v3_filter_integers(request,input_dict,output_dict,widget):
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
    return render(request, 'interactions/MUSE_v3_filter_integers.html',{'widget':widget,'intList':input_dict['intList']})



def MUSE_string_to_file(request, input_dict, output_dict, widget):
    from mothra.settings import MEDIA_ROOT
    from workflows.helpers import ensure_dir

    basename = '/'.join([str(request.user.id), str(widget.id) + str(input_dict['fending'])])
    destination = '/'.join([MEDIA_ROOT, basename])
    ensure_dir(destination)
    with open(destination, 'w') as f:
        f.write(str(input_dict['data']))
    return render(request, 'visualizations/MUSE_string_to_file.html', {'widget': widget, 'fileURL': basename})