Gustavo Picon is sharing code with you

Bitbucket is a code hosting site. Unlimited public and private repositories. Free for small teams.

Don't show this again

tabo / django-treebeard

Efficient tree implementations for Django 1.0+ :: https://tabo.pe/projects/django-treebeard/

Clone this repository (size: 602.0 KB): HTTPS / SSH
hg clone https://bitbucket.org/tabo/django-treebeard
hg clone ssh://hg@bitbucket.org/tabo/django-treebeard

Issues

#30 Delete with deep = False

Reported by Sardar Yumatov (last edited )

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)

Status: open Responsible: Gustavo Picon Type: enhancement Priority: major
Milestone: none Component: none Version: none

Attachments

No attachments added for this issue yet.

Comments and changes

  1. #1 Gustavo Picon

    written

    • Changed status from new 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).

Add comment / attachment

Show/hide preview

Verification: Please write the text from the image in the box (letters only)

captcha

Is that you, Humanoid? Is this me?