+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)
+def delete(origin, self, *args, **kwargs):
+ delete_docs(self)
+ transaction.commit_unless_managed()
+ origin(self, *args, **kwargs)