def post_odai(form): odai = form.getfirst('m') if not odai: return name = form.getfirst('n') if name: name = name.decode('utf8') odai_id = dbsubr.add_odai(fix_nl(odai.decode('utf8')), name) dbsubr.commit() print 'Content-Type: text/html;charset=utf-8' print print format_odai(dbsubr.get_odai(odai_id), 'first')
def post_come(form): odai_id = form.getfirst('id') if not odai_id: return come = form.getfirst('m') if not come: return name = form.getfirst('n') if name: name = name.decode('utf8') come_id = dbsubr.add_come(odai_id, fix_nl(come.decode('utf8')), name) dbsubr.commit() print 'Content-Type: text/html;charset=utf-8' print print format_come(dbsubr.get_come(come_id), 'first')