您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 
 
 
 

14 行
400 B

  1. import frappe
  2. def execute():
  3. update_routes(['Blog Post', 'Blog Category', 'Web Page'])
  4. def update_routes(doctypes):
  5. """Patch old routing system"""
  6. for d in doctypes:
  7. try:
  8. frappe.db.sql("""update `tab{0}` set route = concat(ifnull(parent_website_route, ""),
  9. if(ifnull(parent_website_route, "")="", "", "/"), page_name)""".format(d))
  10. except Exception, e:
  11. if e.args[0]!=1054: raise e