From 390a606c867e39c828628322621419d9d2bce453 Mon Sep 17 00:00:00 2001 From: hernani Date: Fri, 10 Sep 2010 13:19:54 +0000 Subject: [PATCH] Adds the hability to hard delete nodes in the bulk manager, and renames the tool. git-svn-id: http://svn.osqa.net/svnroot/osqa/trunk@588 0cfe37f9-358a-4d5e-be75-b63607b5c754 --- .../default/templates/osqaadmin/nodeman.html | 2 +- forum/views/admin.py | 2 +- forum_modules/pgfulltext/handlers.py | 15 ++++----------- 3 files changed, 6 insertions(+), 13 deletions(-) diff --git a/forum/skins/default/templates/osqaadmin/nodeman.html b/forum/skins/default/templates/osqaadmin/nodeman.html index f96d13b..af8d1ce 100644 --- a/forum/skins/default/templates/osqaadmin/nodeman.html +++ b/forum/skins/default/templates/osqaadmin/nodeman.html @@ -284,7 +284,7 @@ diff --git a/forum/views/admin.py b/forum/views/admin.py index ec77076..0fa5333 100644 --- a/forum/views/admin.py +++ b/forum/views/admin.py @@ -418,7 +418,7 @@ class NodeManagementPaginatorContext(pagination.PaginatorContext): (_('act_at_asc'), pagination.SimpleSort(_('act_at_asc'), 'last_activity_at', "")), ), pagesizes=(default_pagesize,), force_sort='added_at', default_pagesize=default_pagesize, prefix=prefix) -@admin_tools_page(_("nodeman"), _("Node management")) +@admin_tools_page(_("nodeman"), _("Bulk management")) def node_management(request): if request.POST and "save_filter" in request.POST: filter_name = request.POST.get('filter_name', _('filter')) diff --git a/forum_modules/pgfulltext/handlers.py b/forum_modules/pgfulltext/handlers.py index 9d8f954..780bfa9 100644 --- a/forum_modules/pgfulltext/handlers.py +++ b/forum_modules/pgfulltext/handlers.py @@ -28,18 +28,11 @@ def question_search(self, keywords): ) -def delete_docs(node): - cursor = connection.cursor() - cursor.execute("DELETE FROM forum_rootnode_doc WHERE node_id = %s" % (node.id)) - - for n in node.children.all(): - delete_docs(n) - - -#@decorate(Node.delete) +@decorate(Node.delete) def delete(origin, self, *args, **kwargs): - delete_docs(self) + cursor = connection.cursor() + cursor.execute("DELETE FROM forum_rootnode_doc WHERE node_id = %s" % (self.id)) transaction.commit_unless_managed() - origin(self, *args, **kwargs) + return origin(self, *args, **kwargs) -- 2.39.5