Пример #1
0
Файл: msg.py Проект: 42qu/znote
 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))
Пример #2
0
 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))
Пример #3
0
Файл: msg.py Проект: 42qu/zqa
 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))
Пример #4
0
Файл: msg.py Проект: alemic/zqa
 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))
Пример #5
0
Файл: index.py Проект: 42qu/zqa
    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)
Пример #6
0
    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)