소스 검색

commit after every 100 in rebuild_tree

version-14
Nabin Hait 14 년 전
부모
커밋
acba58a01c
1개의 변경된 파일2개의 추가작업 그리고 0개의 파일을 삭제
  1. +2
    -0
      cgi-bin/webnotes/utils/nestedset.py

+ 2
- 0
cgi-bin/webnotes/utils/nestedset.py 파일 보기

@@ -156,6 +156,8 @@ def rebuild_tree(doctype, parent_field):
result = webnotes.conn.sql("SELECT name FROM `tab%s` WHERE `%s`='' or `%s` IS NULL" % (doctype, parent_field, parent_field)) result = webnotes.conn.sql("SELECT name FROM `tab%s` WHERE `%s`='' or `%s` IS NULL" % (doctype, parent_field, parent_field))
for r in result: for r in result:
right = rebuild_node(doctype, r[0], right, parent_field) right = rebuild_node(doctype, r[0], right, parent_field)
webnotes.conn.sql("commit")
webnotes.conn.sql("start transaction")
def rebuild_node(doctype, parent, left, parent_field, cnt = 0): def rebuild_node(doctype, parent, left, parent_field, cnt = 0):
""" """


불러오는 중...
취소
저장