[knowledge base] removed and added patch to move to notes
This commit is contained in:
parent
9c5f4fe165
commit
b4a2949c37
20
patches/may_2013/p06_make_notes.py
Normal file
20
patches/may_2013/p06_make_notes.py
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
import webnotes
|
||||||
|
|
||||||
|
def execute():
|
||||||
|
webnotes.reload_doc("utilities", "doctype", "note")
|
||||||
|
for question in webnotes.conn.sql("""select * from tabQuestion""", as_dict=True):
|
||||||
|
name = question.question[:180]
|
||||||
|
if webnotes.conn.exists("Note", name):
|
||||||
|
webnotes.delete_doc("Note", name)
|
||||||
|
note = webnotes.bean({
|
||||||
|
"doctype":"Note",
|
||||||
|
"title": name,
|
||||||
|
"content": "<hr>".join(webnotes.conn.sql_list("""select answer from tabAnswer
|
||||||
|
where question=%s""", question.name)),
|
||||||
|
"owner": question.owner,
|
||||||
|
"creation": question.creation,
|
||||||
|
"public": 1
|
||||||
|
}).insert()
|
||||||
|
|
||||||
|
webnotes.delete_doc("DocType", "Question")
|
||||||
|
webnotes.delete_doc("DocType", "Answer")
|
||||||
Loading…
x
Reference in New Issue
Block a user