Open witzawitz opened 10 years ago
@witzawitz Sorting possible via root field.
Current behavior logic: $model->root = $model->pk
.
New logic is: $model->root = MAX(root)+1
.
You can use next workaround: https://gist.github.com/max107/10723289.
_WARNING_ Single root mode removed from class.
Based on django-mptt logic.
How to move root before/after other root (for example move Cars before Mobile phones)?
How to move root before/after other root (for example move Cars before Mobile phones)?
The same problem.
https://gist.github.com/max107/10723289 like a django-mptt
When I try to do so an exceprion occurs. So I guess this happens because of restarting the 'lft' and 'rgt' indexes within every root node. It's really not a good practice.
Here's some info on stackoverflow http://stackoverflow.com/questions/1773343/how-to-query-nested-set-model-with-multiple-roots-plus-filtering