コード例 #1
0
ファイル: service.py プロジェクト: cccarey/demisauce
 def appedit(self,id=0):
     #log.info('what the heck, in edit %s' % id)
     id = request.POST['app_id']
     site = Site.get(-1,c.site_id)
     if id == 0 or id == None or id == '0':
         app = App()
         app.site_id = site.id
         app.owner_id = c.user.id
         log.info('hm, id == 0')
     else:
         app = App.get(site.id,id)
     
     app.slug = sanitize(request.POST['real_permalink2'])
     app.name = sanitize(request.POST['app_name'])
     app.authn = sanitize(request.POST['authn'])
     app.description = sanitize(request.POST['description'])
     app.base_url = sanitize(request.POST['base_url'])
     app.save()
     return app.id
コード例 #2
0
ファイル: service.py プロジェクト: araddon/demisauce
 def appedit(self,id=0):
     log.info('what the heck, in edit %s' % id)
     id = self.get_argument("app_id")
     site = Site.get(-1,self.user.site_id)
     if id == 0 or id == None or id == '0':
         app = App()
         app.site_id = site.id
         app.owner_id = self.user.id
         log.info('hm, id == 0')
     else:
         app = App.get(site.id,id)
     log.info('args = %s' % (str(self.request.arguments)))
     app.slug = sanitize(self.get_argument('real_permalink2'))
     app.name = sanitize(self.get_argument('app_name'))
     app.authn = sanitize(self.get_argument('authn'))
     #if 'description' in self.request.arguments:
     app.description = sanitize(self.get_argument('description',''))
     app.base_url = sanitize(self.get_argument('base_url'))
     app.save()
     self.write(str(app.id))