brotherton-erpnext/patches/march_2013/p03_rename_blog_to_blog_post.py

10 lines
423 B
Python
Raw Normal View History

import webnotes
def execute():
webnotes.reload_doc('website', 'doctype', 'blogger')
webnotes.rename_doc("DocType", "Blog", "Blog Post", force=True)
2013-03-11 09:06:12 +00:00
webnotes.reload_doc('website', 'doctype', 'blog_post')
2013-03-11 09:05:25 +00:00
webnotes.conn.sql('''update tabBlogger set posts=(select count(*)
from `tabBlog Post` where ifnull(blogger,"")=tabBlogger.name)''')
webnotes.conn.sql("""update `tabBlog Post` set published_on=date(creation)""")