Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't move root nodes in many roots mode #33

Open
witzawitz opened this issue Jan 17, 2014 · 4 comments
Open

Can't move root nodes in many roots mode #33

witzawitz opened this issue Jan 17, 2014 · 4 comments
Assignees

Comments

@witzawitz
Copy link

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

@ghost ghost assigned creocoder Jan 17, 2014
@max107
Copy link
Contributor

max107 commented Apr 15, 2014

@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.

@yuracher
Copy link

How to move root before/after other root (for example move Cars before Mobile phones)?

@andreymeretsky
Copy link

How to move root before/after other root (for example move Cars before Mobile phones)?

The same problem.

@max107
Copy link
Contributor

max107 commented Mar 31, 2016

https://gist.github.com/max107/10723289 like a django-mptt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants