Esempio n. 1
0
 def GET(self,text):
     text = any2str(text)
     flist,msg = models.get_fields_name(text)
     f = DynamicForm()
     custom_master(f,flist)
     if msg == '' : 
         msg = models.if_table_exists(text,config.MDM)
     return web.template.render('templates/',base='base',globals={'session':web.ctx.session}).master_data(f,msg)
Esempio n. 2
0
 def POST(self,text):
     text = any2str(text)
     flist,msg = models.get_fields_name(text)
     f = DynamicForm()
     custom_master(f,flist)
     if not f.validates() or msg != '':
         msg = ERR_NOTNULL
         return web.template.render('templates/',base='base',globals={'session':web.ctx.session}).master_data(f,msg)
     else :
         tbinfo = [text]
         fw = web.input()
         mflist = [any2str(flist[idx]) for idx in range(len(flist)) if fw.has_key(str(idx))]
         tbinfo.append(','.join(mflist))
         print tbinfo[1]
         msg = models.insert_column(config.MDM,tbinfo,('text','text'))
         models.db.commit()
         if msg != '':
             return web.template.render('templates/',base='base',globals={'session':web.ctx.session}).master_data(f,msg)
         else :
             raise web.seeother('/../')