示例#1
0
文件: users.py 项目: Python3pkg/DARE
    def register_post(self):
        if (c.userid != "false"):
            redirect(url('/users/register?m=3'))

        if request.method == 'POST':
            c.form = RegisterForm(request.POST)
            if c.form.is_valid():
                newuser = model.user()
                # check to see if email allready exists
                email_users = meta.Session.query(model.user)

                if (validate_email(c.form.cleaned_data['email'])):
                    c.email = "invalid"
                    print("invalid email")
                    return render("/users/register.mako")

                newuser.email = c.form.cleaned_data['email']

                newuser.organization = c.form.cleaned_data['organization']
                newuser.password = c.form.cleaned_data['password']
                print("c.form.cleaned_data['password']",
                      c.form.cleaned_data['password'])
                newuser.salt = "salt"
                meta.Session.add(newuser)
                meta.Session.commit()

                return render("/users/succ_register.mako")
            else:
                c.form = RegisterForm(request.POST)
        return render("/users/register.mako")
示例#2
0
    def register_post(self):
        if (c.userid != "false"):
             redirect(url('/users/register?m=3'))
           
        if request.method == 'POST':
            c.form = RegisterForm(request.POST)
            if c.form.is_valid():
                newuser= model.user()
                # check to see if email allready exists
                email_users = meta.Session.query(model.user)

                if (validate_email(c.form.cleaned_data['email'])):
                    c.email = "invalid"
                    print "invalid email"
                    return render("/users/register.mako")


                newuser.email = c.form.cleaned_data['email']

                newuser.organization = c.form.cleaned_data['organization']
                newuser.password =      c.form.cleaned_data['password']
                print "c.form.cleaned_data['password']", c.form.cleaned_data['password']
                newuser.salt =  "salt"
                meta.Session.add(newuser)
                meta.Session.commit()

                return render("/users/succ_register.mako")
            else:
                c.form = RegisterForm(request.POST)
        return render("/users/register.mako")
示例#3
0
    def login_validate(self):
        if (c.userid != "false"):
             redirect(url('/users/login?m=2'))
        session['logged_in'] = True
        session.save()    
            
        if request.method == 'POST':
            c.form = LoginForm(request.POST)
            if c.form.is_valid():

                userid = authenticate_user(c.form.cleaned_data['email'], \
                         c.form.cleaned_data['password'])
                print "hellooooo", c.form.cleaned_data['email'], c.form.cleaned_data['password']
                if (userid != "invalid" ):
                    session['userid'] = userid
                    session.save()
                    print session['userid']
                    redirect(url('/'))
                    c.login = "******"
                else:
                 c.login = "******"

            else:
                 c.form = LoginForm(request.POST)

        return render("/users/login.mako")
示例#4
0
文件: ngs.py 项目: icheckmate/DARE-1
    def job_table_view(self):

        user_jobs = meta.Session.query(model.job).all()

        c.jobs = paginate.Page(user_jobs, items_per_page=10)
        total_pages = len(user_jobs)/10 + 1

        #jobs = meta.Session.query(model.job)
        #if (len(user_jobs)!=0):
         #   print "\njobs------\n",jobs.first().jobinfo[1].key, jobs.first().jobinfo[1].value

        # to check if user visiting this page for  the first time and
        #assign the latest jobs page,page_num tell which page to show


        page_num  =   total_pages
        if ('page' in request.params) and request.params['page']. isdigit() and (int(request.params['page']) <= total_pages):
                page_num =int(request.params['page'])

        if 'm' in request.params:
                c.display_message = "Job successfully submitted and your Job ID is " \
                + str(request.params['id'])

        c.jobs = paginate.Page(user_jobs, page=page_num, items_per_page=10)
        c.pagenums=c.jobs.pager()
        c.pagenumber = page_num
        return render("/job_table_view.mako")
示例#5
0
文件: ngs.py 项目: icheckmate/DARE-1
    def job_insert(self):
        if (c.userid == "false"):
             redirect(url('/users/login?m=1'))

        #extra_questions = get_questions(request)
        #form = UserCreationForm(request.POST or None, extra=extra_questions)

        if request.method == 'POST':
            appname  = request.POST['appname']
            if (appname =='tophatfusion'):
               c.form = tophatfusionForm(request.POST,request.POST )
            elif (appname =='bfast') :
               c.form = bfastForm(request.POST,request.POST )
            elif (appname =='chipseq') :
               c.form = chipseqForm(request.POST,request.POST )

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

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

                update_job_status(jobid, str(JOBSTATES.NEW))
                redirect(url('/ngs/job_table_view?m=1&id=' + str(jobid) ))
            else:
                return render('/forms/chipseq_form.mako')
示例#6
0
文件: ngs.py 项目: Python3pkg/DARE
    def job_insert(self):
        if (c.userid == "false"):
             redirect(url('/users/login?m=1'))

        #extra_questions = get_questions(request)
        #form = UserCreationForm(request.POST or None, extra=extra_questions)

        if request.method == 'POST':
            appname  = request.POST['appname']
            if (appname =='tophatfusion'):
               c.form = tophatfusionForm(request.POST,request.POST )
            elif (appname =='bfast') :
               c.form = bfastForm(request.POST,request.POST )
            elif (appname =='chipseq') :
               c.form = chipseqForm(request.POST,request.POST )

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

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

                update_job_status(jobid, str(JOBSTATES.NEW))
                redirect(url('/ngs/job_table_view?m=1&id=' + str(jobid) ))
            else:
                return render('/forms/chipseq_form.mako')
示例#7
0
文件: ngs.py 项目: Python3pkg/DARE
    def job_table_view(self):

        user_jobs = meta.Session.query(model.job).all()

        c.jobs = paginate.Page(user_jobs, items_per_page=10)
        total_pages = len(user_jobs)/10 + 1

        #jobs = meta.Session.query(model.job)
        #if (len(user_jobs)!=0):
         #   print "\njobs------\n",jobs.first().jobinfo[1].key, jobs.first().jobinfo[1].value

        # to check if user visiting this page for  the first time and
        #assign the latest jobs page,page_num tell which page to show


        page_num  =   total_pages
        if ('page' in request.params) and request.params['page']. isdigit() and (int(request.params['page']) <= total_pages):
                page_num =int(request.params['page'])

        if 'm' in request.params:
                c.display_message = "Job successfully submitted and your Job ID is " \
                + str(request.params['id'])

        c.jobs = paginate.Page(user_jobs, page=page_num, items_per_page=10)
        c.pagenums=c.jobs.pager()
        c.pagenumber = page_num
        return render("/job_table_view.mako")
示例#8
0
文件: users.py 项目: Python3pkg/DARE
    def login_validate(self):
        if (c.userid != "false"):
            redirect(url('/users/login?m=2'))
        session['logged_in'] = True
        session.save()

        if request.method == 'POST':
            c.form = LoginForm(request.POST)
            if c.form.is_valid():

                userid = authenticate_user(c.form.cleaned_data['email'], \
                         c.form.cleaned_data['password'])
                print("hellooooo", c.form.cleaned_data['email'],
                      c.form.cleaned_data['password'])
                if (userid != "invalid"):
                    session['userid'] = userid
                    session.save()
                    print(session['userid'])
                    redirect(url('/'))
                    c.login = "******"
                else:
                    c.login = "******"

            else:
                c.form = LoginForm(request.POST)

        return render("/users/login.mako")
示例#9
0
    def register(self):
        if 'm' in request.params:
            m = request.params['m']

            if (int(m) ==3):
                c.display_message = "Please log out before you register "    
        elif (c.userid != "false"):
             redirect(url('/users/regitser?m=3'))
        
        c.form = RegisterForm()
        return render('/users/register.mako')
示例#10
0
文件: users.py 项目: Python3pkg/DARE
    def register(self):
        if 'm' in request.params:
            m = request.params['m']

            if (int(m) == 3):
                c.display_message = "Please log out before you register "
        elif (c.userid != "false"):
            redirect(url('/users/regitser?m=3'))

        c.form = RegisterForm()
        return render('/users/register.mako')
示例#11
0
    def login(self):
        #h.flash('Please login')

        if 'm' in request.params:
           m = request.params['m']
           if (int(m) ==1):
               c.display_message = "Please log in before you submit a job "
           if (int(m) ==2):
               c.display_message = "Please log out before you login "
           if (int(m) ==4):
               c.display_message = "Please log in before you delete a job "
                
        elif (c.userid != "false"):
             redirect(url('/users/login?m=2'))
             
        c.form = LoginForm()
        return render('/users/login.mako')
示例#12
0
文件: users.py 项目: Python3pkg/DARE
    def login(self):
        #h.flash('Please login')

        if 'm' in request.params:
            m = request.params['m']
            if (int(m) == 1):
                c.display_message = "Please log in before you submit a job "
            if (int(m) == 2):
                c.display_message = "Please log out before you login "
            if (int(m) == 4):
                c.display_message = "Please log in before you delete a job "

        elif (c.userid != "false"):
            redirect(url('/users/login?m=2'))

        c.form = LoginForm()
        return render('/users/login.mako')
示例#13
0
文件: ngs.py 项目: icheckmate/DARE-1
 def dalliance(self):
     """ dalliance visual"""
     return render('/dalliance.mako')
示例#14
0
文件: ngs.py 项目: Python3pkg/DARE
 def bfast_form(self):
     if (c.userid == "false"):
          redirect(url('/users/login?m=1'))
     c.form = bfastForm()
     return render('/forms/bfast_form.mako')
示例#15
0
文件: ngs.py 项目: icheckmate/DARE-1
 def using_bfast(self):
     return render('/pages/using_bfast.mako')
示例#16
0
文件: ngs.py 项目: Python3pkg/DARE
 def resources(self):
     return render('/pages/resources.mako')
示例#17
0
文件: ngs.py 项目: Python3pkg/DARE
 def software(self):
     return render('/pages/software.mako')
示例#18
0
文件: ngs.py 项目: Python3pkg/DARE
 def about(self):
     return render('/pages/about.mako')
示例#19
0
文件: ngs.py 项目: Python3pkg/DARE
 def using_tophatfusion(self):
     return render('/pages/using_tophatfusion.mako')
示例#20
0
文件: ngs.py 项目: icheckmate/DARE-1
 def tophatfusion_form(self):
     if (c.userid == "false"):
          redirect(url('/users/login?m=1'))
     c.form = tophatfusionForm()
     return render('/forms/tophatfusion_form.mako')
示例#21
0
文件: ngs.py 项目: icheckmate/DARE-1
 def using_chipseq(self):
     return render('/pages/using_chipseq.mako')
示例#22
0
文件: ngs.py 项目: icheckmate/DARE-1
 def contact(self):
     return render('/pages/contact.mako')
示例#23
0
文件: ngs.py 项目: icheckmate/DARE-1
 def bfast_form(self):
     if (c.userid == "false"):
          redirect(url('/users/login?m=1'))
     c.form = bfastForm()
     return render('/forms/bfast_form.mako')
示例#24
0
文件: ngs.py 项目: icheckmate/DARE-1
 def software(self):
     return render('/pages/software.mako')
示例#25
0
文件: ngs.py 项目: icheckmate/DARE-1
 def trac(self):
     return render('/pages/trac.mako')
示例#26
0
文件: ngs.py 项目: icheckmate/DARE-1
 def resources(self):
     return render('/pages/resources.mako')
示例#27
0
文件: ngs.py 项目: icheckmate/DARE-1
 def chipseq_form(self):
     if (c.userid == "false"):
          redirect(url('/users/login?m=1'))
     c.form = chipseqForm()
     return render('/forms/chipseq_form.mako')
示例#28
0
文件: ngs.py 项目: icheckmate/DARE-1
 def about(self):
     return render('/pages/about.mako')
示例#29
0
文件: ngs.py 项目: Python3pkg/DARE
    def index(self):

        return render('/pages/index.mako')
示例#30
0
文件: ngs.py 项目: icheckmate/DARE-1
    def index(self):

        return render('/pages/index.mako')
示例#31
0
文件: ngs.py 项目: Python3pkg/DARE
 def using_chipseq(self):
     return render('/pages/using_chipseq.mako')
示例#32
0
文件: ngs.py 项目: icheckmate/DARE-1
 def tophatfusion_view(self):
     """ dalliance visual"""
     jobid= request.params['id']
     if jobid is None:
        redirect(url('/ngs/job_table_view'))
     return render('/results/result_'+ jobid+'.mako')
示例#33
0
文件: ngs.py 项目: Python3pkg/DARE
 def using_bfast(self):
     return render('/pages/using_bfast.mako')
示例#34
0
文件: ngs.py 项目: Python3pkg/DARE
 def chipseq_form(self):
     if (c.userid == "false"):
          redirect(url('/users/login?m=1'))
     c.form = chipseqForm()
     return render('/forms/chipseq_form.mako')
示例#35
0
文件: ngs.py 项目: Python3pkg/DARE
 def trac(self):
     return render('/pages/trac.mako')
示例#36
0
文件: ngs.py 项目: Python3pkg/DARE
 def dalliance(self):
     """ dalliance visual"""
     return render('/dalliance.mako')
示例#37
0
文件: ngs.py 项目: Python3pkg/DARE
 def contact(self):
     return render('/pages/contact.mako')
示例#38
0
文件: ngs.py 项目: Python3pkg/DARE
 def tophatfusion_view(self):
     """ dalliance visual"""
     jobid= request.params['id']
     if jobid is None:
        redirect(url('/ngs/job_table_view'))
     return render('/results/result_'+ jobid+'.mako')
示例#39
0
文件: ngs.py 项目: Python3pkg/DARE
 def tophatfusion_form(self):
     if (c.userid == "false"):
          redirect(url('/users/login?m=1'))
     c.form = tophatfusionForm()
     return render('/forms/tophatfusion_form.mako')
示例#40
0
文件: ngs.py 项目: icheckmate/DARE-1
 def using_tophatfusion(self):
     return render('/pages/using_tophatfusion.mako')