Example #1
0
def initiate_request(request):
    # if this is a POST request we need to process the form data
    env = environment(loader=FileSystemLoader(TEMPLATE_DIRS))
    if request.method == 'POST':
        # create a form instance and populate it with data from the request:
        outForm = PoolingDownloadForm(request.POST)
        # check whether it's valid:
        if outForm.is_valid():
            outForm_dict = {}
            for item in outForm.cleaned_data.keys():
                if type(outForm.cleaned_data[item]) is not datetime.date:
                    outForm_dict[item] = outForm.cleaned_data[item]
            print "final dict"
            outForm_dict['request_xls_template_path'] = EXCELFILES_FOLDER + "STEP05-RNASeqLibraryPooling.xlsx"
            print outForm_dict
            request.session['outForm'] = outForm_dict
            print request.session['outForm']
            ##db_params(outForm_dict)
            ##outForm_dict['excel'] = download_excel(request)
            env = environment(loader=FileSystemLoader(TEMPLATE_DIRS))
            template = env.get_template('librarypooling/pooling_download.html')
            return HttpResponse(template.render(valData=outForm_dict))
    else:
        myForm = PoolingDownloadForm()
        env = environment(loader=FileSystemLoader(TEMPLATE_DIRS))
        template = env.get_template('librarypooling/pooling_download_init.html')
        return HttpResponse(template.render(form=myForm))
Example #2
0
def initiate_request(request):
    # if this is a POST request we need to process the form data
    env = environment(loader=FileSystemLoader(TEMPLATE_DIRS))
    if request.method == 'POST':
        print request.FILES.keys()
        # create a form instance and populate it with data from the request:
        outForm = PullRequestUploadForm(request.POST)

        # check whether it's valid:
        print "form loaded"
        if outForm.is_valid():
            print outForm.cleaned_data
        print "form validates"
        update_db_pull_info(request.FILES['manifest_file'])

        env = environment(loader=FileSystemLoader(TEMPLATE_DIRS))
        template = env.get_template('base.html')
        return HttpResponse(template.render())
    else:
        myForm = PullRequestUploadForm()
        env = environment(loader=FileSystemLoader(TEMPLATE_DIRS))
        template = env.get_template(
            'pull_request/pull_request_upload_init.html')
        return HttpResponse(template.render(form=myForm))
Example #3
0
def navpage(request):
    env = environment(loader=FileSystemLoader(TEMPLATE_DIRS))
    template = env.get_template('base.html')
    return HttpResponse(template.render())