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))