def get(self,id): r = getmsg(id) if not r: self.redirect('/') else: info = dict() info['id'] = r['id'] info['who'] = r['who'].encode('utf-8') info['text'] = r['t'].encode('utf-8') if r['answer_id']: pass else: info['answer'] = '尚未产生' self.render(info=info,re=getreply(id))
def get(self, id): r = getmsg(id) if not r: self.redirect('/') else: info = dict() info['id'] = r['id'] info['who'] = r['who'].encode('utf-8') info['text'] = r['t'].encode('utf-8') if r['answer_id']: pass else: info['answer'] = '尚未产生' self.render(info=info, re=getreply(id))
def get(self,id): r = getmsg(id) if not r: self.redirect('/') else: info = dict() info['id'] = r['id'] info['who'] = r['who'].encode('utf-8') info['text'] = r['t'].encode('utf-8') if r['answer_id']: re = getreply(r['answer_id']) info['answer'] = { 'text': re['t'].encode('utf-8').replace(r'\n','<br />'), 'who' : re['who'].encode('utf-8') } else: info['answer'] = {'text':'尚未产生','who':None} self.render(info=info,re=getreplys(id))
def get(self, id): r = getmsg(id) if not r: self.redirect('/') else: info = dict() info['id'] = r['id'] info['who'] = r['who'].encode('utf-8') info['text'] = r['t'].encode('utf-8') if r['answer_id']: re = getreply(r['answer_id']) info['answer'] = { 'text': re['t'].encode('utf-8').replace(r'\n', '<br />'), 'who': re['who'].encode('utf-8') } else: info['answer'] = {'text': '尚未产生', 'who': None} self.render(info=info, re=getreplys(id))
def get(self): msg_lst = [] ret = getmsgs() if ret: for i in ret: m = dict() m['id'] = i['id'] m['who'] = i['who'] m['text'] = i['t'].encode('utf-8') if i['answer_id']: re = getreply(i['answer_id']) m['answer'] = { 'text': re['t'].encode('utf-8').replace(r'\n','<br />'), 'who' : re['who'].encode('utf-8') } else: m['answer'] = {'text':'尚未产生','who':None} msg_lst.append(m) self.render(msg_lst=msg_lst)
def get(self): msg_lst = [] ret = getmsgs() if ret: for i in ret: m = dict() m['id'] = i['id'] m['who'] = i['who'] m['text'] = i['t'].encode('utf-8') if i['answer_id']: re = getreply(i['answer_id']) m['answer'] = { 'text': re['t'].encode('utf-8').replace(r'\n', '<br />'), 'who': re['who'].encode('utf-8') } else: m['answer'] = {'text': '尚未产生', 'who': None} msg_lst.append(m) self.render(msg_lst=msg_lst)