Beispiel #1
0
 def post(self):
     cid = self.get_argument('cid', None)
     if cid:
         comments = Course.get_all_comments(cid)
         a = []
         for i in comments:
             a.append({'cmtid': i.cmtid, 'author': i.author, 'content': i.comment, 'like': i.like, 'unlike': i.unlike, 'status': i.status })
         b = {'all': a}
         json_str = json.dumps(b, ensure_asii = False)
         self.write(json_str)
     else:
         self.write('0')