Issues

Issue #30 open

Delete with deep = False

Sardar Yumatov avatarSardar Yumatov created an issue

Sometimes we need to delete the node leaving all children in place (inserting them at the parent's place). A .delete(deep = False) will be really useful in this case.

This is low-priority enhancement because we can manually move the subtree (N children queries) and then delete the parent. With deep = False this can be done more efficient.

Alternatively .delete_node(deep = True) method can implement this functionality, such that standard .delete() will call it with deep = True. This approach avoids introducing non-standard argument to .delete() (consistency)

Comments (5)

  1. Gustavo Picon
    • changed status to open

    I'm really liking this. And it wouldn't break current apps.

    I think we can include this in the next release, at least with a naive implementation. Ideally, it should have an efficient implementation (1-2 queries) for all trees (AL/MP/NS).

  2. Log in to comment
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.