Exemplo n.º 1
0
 def get(self, id = ''):
     obj = None
     if id:
         obj = Comment.get_comment_by_id(id)
         if obj:
             act = self.get_argument("act",'')
             if act == 'del':
                 Comment.del_comment_by_id(id)
                 clear_cache_by_pathlist(['post:%d'%obj.postid])
                 self.redirect('%s/admin/comment/'% (BASE_URL))
                 return
     self.echo('admin_comment.html', {
         'title': "管理评论",
         'cats': Category.get_all_cat_name(),
         'tags': Tag.get_all_tag_name(),
         'obj': obj,
         'comments': Comment.get_recent_comments(),
     },layout='_layout_admin.html')        
Exemplo n.º 2
0
 def get(self, id = ''):
     obj = None
     if id:
         obj = Comment.get_comment_by_id(id)
         if obj:
             act = self.get_argument("act",'')
             if act == 'del':
                 Comment.del_comment_by_id(id)
                 clear_cache_by_pathlist(['post:%d'%obj.postid])
                 self.redirect('%s/admin/comment/'% (BASE_URL))
                 return
     self.echo('admin_comment.html', {
         'title': "管理评论",
         'cats': Category.get_all_cat_name(),
         'tags': Tag.get_all_tag_name(),
         'obj': obj,
         'comments': Comment.get_recent_comments(),
     },layout='_layout_admin.html')
Exemplo n.º 3
0
 def get(self, id=""):
     obj = None
     if id:
         obj = Comment.get_comment_by_id(id)
         if obj:
             act = self.get_argument("act", "")
             if act == "del":
                 Comment.del_comment_by_id(id)
                 if MYSQL_TO_KVDB_SUPPORT:
                     clear_cache_by_pathlist(["post:%d" % obj["postid"]])
                 else:
                     clear_cache_by_pathlist(["post:%d" % obj.postid])
                 self.redirect("%s/admin/comment/" % (BASE_URL))
                 return
     self.echo(
         "admin_comment.html",
         {"title": "管理评论", "obj": obj, "comments": Comment.get_recent_comments(ADMIN_RECENT_COMMENT_NUM)},
         layout="_layout_admin.html",
     )
Exemplo n.º 4
0
 def get(self, id=""):
     obj = None
     if id:
         obj = Comment.get_comment_by_id(id)
         if obj:
             act = self.get_argument("act", "")
             if act == "del":
                 Comment.del_comment_by_id(id)
                 clear_cache_by_pathlist(["post:%d" % obj.postid])
                 self.redirect("%s/admin/comment/" % (BASE_URL))
                 return
     self.echo(
         "admin_comment.html",
         {
             "title": "管理评论",
             "cats": Category.get_all_cat_name(),
             "tags": Tag.get_all_tag_name(),
             "obj": obj,
             "comments": Comment.get_recent_comments(),
         },
         layout="_layout_admin.html",
     )
Exemplo n.º 5
0
 def get(self, id=''):
     obj = None
     if id:
         obj = Comment.get_comment_by_id(id)
         if obj:
             act = self.get_argument("act", '')
             if act == 'del':
                 Comment.del_comment_by_id(id)
                 if MYSQL_TO_KVDB_SUPPORT:
                     clear_cache_by_pathlist(
                         ['post:%d' % int(obj['postid'])])
                 else:
                     clear_cache_by_pathlist(['post:%d' % int(obj.postid)])
                 self.redirect('%s/admin/comment/' % (BASE_URL))
                 return
     self.echo(
         'admin_comment.html', {
             'title': "管理评论",
             'obj': obj,
             'comments':
             Comment.get_recent_comments(ADMIN_RECENT_COMMENT_NUM),
         },
         layout='_layout_admin.html')