예제 #1
0
파일: mobile.py 프로젝트: feilaoda/kd
 def doadd(self):
     soft = Software()
     soft.name = self.form_result.get('software_name')
     soft.download_url =  self.form_result.get('download_url')
     Session.add(soft)
     Session.commit()        
     redirect(url(controller="mobile", action="index"))
예제 #2
0
파일: mobile.py 프로젝트: feilaoda/kd
 def doadd(self):
     soft = Software()
     soft.name = self.form_result.get('software_name')
     soft.download_url = self.form_result.get('download_url')
     Session.add(soft)
     Session.commit()
     redirect(url(controller="mobile", action="index"))
예제 #3
0
파일: mobile.py 프로젝트: feilaoda/kd
            c.form_errors = error.error_dict or {}
            soft_id = id
            if soft_id == 0:
                redirect(url(controller="mobile", action="index"))        
            soft = Session.query(Software).filter(Software.id == soft_id).first()
            #if not soft is None:            
            c.soft = soft
            html = render('/mobile/edit.html')
            return htmlfill.render(
                html,
                defaults=c.form_result,
                errors=c.form_errors
                #auto_error_formatter=self.custom_formatter
            )
        else:              
            soft = Software()
            soft.id = c.form_result.get('software_id')
            soft.name = c.form_result.get('software_name')
            soft.download_url =  c.form_result.get('download_url')
            Session.update(soft)
            Session.commit()        
            redirect(url(controller="mobile", action="index"))     
        

    
#    def newnode(self, id):
#      c.parent_id = id
#      return render('newnode.html')
#    
#    @validate(schema=NewSoftwareForm(), form='add')
#    def createnode(self):
예제 #4
0
파일: mobile.py 프로젝트: feilaoda/kd
            c.form_errors = error.error_dict or {}
            soft_id = id
            if soft_id == 0:
                redirect(url(controller="mobile", action="index"))
            soft = Session.query(Software).filter(
                Software.id == soft_id).first()
            #if not soft is None:
            c.soft = soft
            html = render('/mobile/edit.html')
            return htmlfill.render(html,
                                   defaults=c.form_result,
                                   errors=c.form_errors
                                   #auto_error_formatter=self.custom_formatter
                                   )
        else:
            soft = Software()
            soft.id = c.form_result.get('software_id')
            soft.name = c.form_result.get('software_name')
            soft.download_url = c.form_result.get('download_url')
            Session.update(soft)
            Session.commit()
            redirect(url(controller="mobile", action="index"))


#    def newnode(self, id):
#      c.parent_id = id
#      return render('newnode.html')
#
#    @validate(schema=NewSoftwareForm(), form='add')
#    def createnode(self):
#      soft_name = self.form_result.get('software_name')