File tree Expand file tree Collapse file tree 1 file changed +9
-8
lines changed
Expand file tree Collapse file tree 1 file changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -78,14 +78,15 @@ Represented data of tree like dict
7878 {' id' : ' 11' , ' parent_id' : ' 10' },
7979 )
8080
81- Filling data at the first time
82- ------------------------------
83-
84- When you add any data to the database, he tries to be counted lft,
85- rgt and level attribute. This is done very quickly if the tree already
86- exists in the database, but it is absolutely not allowed for initialize
87- the tree, it is very long. In this case, you can change the code like
88- this:
81+ Initializing a tree with data
82+ -----------------------------
83+
84+ When you add nodes to the table, the tree manager subsequently updates the
85+ level, left and right attributes in the reset of the table. This is done very
86+ quickly if the tree already exists in the database, but for initializing the
87+ tree, it might become a big overhead. In this case, it is recommended to
88+ deactivate automatic tree management, fill in the data, reactivate automatic
89+ tree management and finally call manually a rebuild of the tree once at the end:
8990
9091.. no-code-block :: python
9192
You can’t perform that action at this time.
0 commit comments