Пример #1
0
    def namd_job_insert(self):
        if (c.userid == "false"):
             redirect(url('/users/login?m=1'))
        else:
        
            if request.method == 'POST':
                appname  = request.POST['appname']
                if (appname =='namd'):
                    num = request.POST["numresources"]
                    numf = request.POST["numfiles"]
                    
                    p  = NAMDForm(request.POST, request.POST ,numresources=num,numfiles=numf)
                    
                if p.is_valid():
                    #add using job queue
                    jobid =add_job(c.userid)

                    for key in p.cleaned_data:
                        #print "key", key
                        #print "value", c.form.cleaned_data[key]
                        newjobinfo = model.jobinfo()
                        newjobinfo.key = key
                        newjobinfo.value = p.cleaned_data[key]
                        newjobinfo.submitted_time = time.asctime()
                        newjobinfo.jobid = jobid
                        add_jobinfo(newjobinfo)

                    redirect(url('/hthpmd/job_table_view?m=1&id=' + str(jobid) ))
                else:
                    c.form = p
                    return render('/jobforms/dyn_namd_form.mako')
            else:
                redirect(url('/hthpmd/job_table_view'))
Пример #2
0
def add_jobinfo_new(key, value, jobmetaid):
    newjobinfo = model.jobinfo()
    newjobinfo.key = key
    newjobinfo.value = value
    newjobinfo.jobmetaid = jobmetaid

    newjobinfo.submitted_time = time.asctime()
    meta.Session.add(newjobinfo)
    meta.Session.commit()
Пример #3
0
def add_jobinfo_new(key, value, jobmetaid):
    newjobinfo = model.jobinfo()
    newjobinfo.key = key
    newjobinfo.value = value
    newjobinfo.jobmetaid = jobmetaid

    newjobinfo.submitted_time = time.asctime()
    meta.Session.add(newjobinfo)
    meta.Session.commit()
Пример #4
0
    def namd_job_insert(self):
        if (c.userid == "false"):
            redirect(url('/users/login?m=1'))
        else:

            if request.method == 'POST':
                appname = request.POST['appname']
                if (appname == 'namd'):
                    num = request.POST["numresources"]
                    numf = request.POST["numfiles"]

                    p = NAMDForm(request.POST,
                                 request.POST,
                                 numresources=num,
                                 numfiles=numf)

                if p.is_valid():
                    #add using job queue
                    jobid = add_job(c.userid)

                    for key in p.cleaned_data:
                        #print "key", key
                        #print "value", c.form.cleaned_data[key]
                        newjobinfo = model.jobinfo()
                        newjobinfo.key = key
                        newjobinfo.value = p.cleaned_data[key]
                        newjobinfo.submitted_time = time.asctime()
                        newjobinfo.jobid = jobid
                        add_jobinfo(newjobinfo)

                    redirect(url('/hthpmd/job_table_view?m=1&id=' +
                                 str(jobid)))
                else:
                    c.form = p
                    return render('/jobforms/dyn_namd_form.mako')
            else:
                redirect(url('/hthpmd/job_table_view'))