From fe5e8eb1b68e8f3750e304a7cb0e2ecd52426176 Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Tue, 30 Aug 2011 15:44:15 +0530 Subject: [PATCH] delete answer when question is deleted --- knowledge_base/doctype/question/question.py | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 knowledge_base/doctype/question/question.py diff --git a/knowledge_base/doctype/question/question.py b/knowledge_base/doctype/question/question.py new file mode 100644 index 0000000000..5ddee6a507 --- /dev/null +++ b/knowledge_base/doctype/question/question.py @@ -0,0 +1,8 @@ +class DocType: + def __init__(self, d, dl): + self.doc, self.doclist = d, dl + + def on_trash(self): + import webnotes + webnotes.conn.sql("delete from tabAnswer where question=%s", self.doc.name) + \ No newline at end of file