Skip to content

Commit

Permalink
Improved documentation on bulk operations. #41 #42 #45
Browse files Browse the repository at this point in the history
  • Loading branch information
fabiocaccamo committed Dec 7, 2021
1 parent 9236eaa commit a50d02d
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,21 @@ obj.is_sibling_of(target_obj)
cls.update_tree()
```

### Bulk Operations

To perform bulk operations it is recommended to turn off signals, then triggering the tree update at the end:

```python
from treenode.signals import no_signals

with no_signals():
# execute custom bulk operations
pass

# trigger tree update only once
YourModel.update_tree()
```

## Testing
```bash
# create python virtual environment
Expand Down

0 comments on commit a50d02d

Please sign in to comment.