319 lines
No EOL
8 KiB
HTML
319 lines
No EOL
8 KiB
HTML
<!-- title: frappe.utils.nestedset --><div class="dev-header">
|
|
|
|
<a class="btn btn-default btn-sm" disabled style="margin-bottom: 10px;">
|
|
Version 6.6.1</a>
|
|
|
|
|
|
<a class="btn btn-default btn-sm" href="https://github.com/frappe/frappe/blob/v6.6.1/frappe/utils/nestedset.py"
|
|
target="_blank" style="margin-left: 10px; margin-bottom: 10px;"><i class="octicon octicon-mark-github"></i> Source</a>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<h3 style="font-weight: normal;">Class <b>NestedSet</b></h3>
|
|
|
|
<p style="padding-left: 30px;"><i>Inherits from frappe.model.document.Document</i></h4>
|
|
|
|
<div class="docs-attr-desc"><p></p>
|
|
</div>
|
|
<div style="padding-left: 30px;">
|
|
|
|
|
|
|
|
|
|
<p class="docs-attr-name">
|
|
<a name="after_rename" href="#after_rename" class="text-muted small">
|
|
<i class="icon-link small" style="color: #ccc;"></i></a>
|
|
<b>after_rename</b>
|
|
<i class="text-muted">(self, olddn, newdn, merge=False)</i>
|
|
</p>
|
|
<div class="docs-attr-desc"><p><span class="text-muted">No docs</span></p>
|
|
</div>
|
|
<br>
|
|
|
|
|
|
|
|
|
|
|
|
<p class="docs-attr-name">
|
|
<a name="before_rename" href="#before_rename" class="text-muted small">
|
|
<i class="icon-link small" style="color: #ccc;"></i></a>
|
|
<b>before_rename</b>
|
|
<i class="text-muted">(self, olddn, newdn, merge=False, group_fname=is_group)</i>
|
|
</p>
|
|
<div class="docs-attr-desc"><p><span class="text-muted">No docs</span></p>
|
|
</div>
|
|
<br>
|
|
|
|
|
|
|
|
|
|
|
|
<p class="docs-attr-name">
|
|
<a name="get_ancestors" href="#get_ancestors" class="text-muted small">
|
|
<i class="icon-link small" style="color: #ccc;"></i></a>
|
|
<b>get_ancestors</b>
|
|
<i class="text-muted">(self)</i>
|
|
</p>
|
|
<div class="docs-attr-desc"><p><span class="text-muted">No docs</span></p>
|
|
</div>
|
|
<br>
|
|
|
|
|
|
|
|
|
|
|
|
<p class="docs-attr-name">
|
|
<a name="on_trash" href="#on_trash" class="text-muted small">
|
|
<i class="icon-link small" style="color: #ccc;"></i></a>
|
|
<b>on_trash</b>
|
|
<i class="text-muted">(self)</i>
|
|
</p>
|
|
<div class="docs-attr-desc"><p><span class="text-muted">No docs</span></p>
|
|
</div>
|
|
<br>
|
|
|
|
|
|
|
|
|
|
|
|
<p class="docs-attr-name">
|
|
<a name="on_update" href="#on_update" class="text-muted small">
|
|
<i class="icon-link small" style="color: #ccc;"></i></a>
|
|
<b>on_update</b>
|
|
<i class="text-muted">(self)</i>
|
|
</p>
|
|
<div class="docs-attr-desc"><p><span class="text-muted">No docs</span></p>
|
|
</div>
|
|
<br>
|
|
|
|
|
|
|
|
|
|
|
|
<p class="docs-attr-name">
|
|
<a name="validate_ledger" href="#validate_ledger" class="text-muted small">
|
|
<i class="icon-link small" style="color: #ccc;"></i></a>
|
|
<b>validate_ledger</b>
|
|
<i class="text-muted">(self, group_identifier=is_group)</i>
|
|
</p>
|
|
<div class="docs-attr-desc"><p><span class="text-muted">No docs</span></p>
|
|
</div>
|
|
<br>
|
|
|
|
|
|
|
|
|
|
|
|
<p class="docs-attr-name">
|
|
<a name="validate_one_root" href="#validate_one_root" class="text-muted small">
|
|
<i class="icon-link small" style="color: #ccc;"></i></a>
|
|
<b>validate_one_root</b>
|
|
<i class="text-muted">(self)</i>
|
|
</p>
|
|
<div class="docs-attr-desc"><p><span class="text-muted">No docs</span></p>
|
|
</div>
|
|
<br>
|
|
|
|
|
|
</div>
|
|
<hr>
|
|
|
|
|
|
|
|
|
|
|
|
<h3 style="font-weight: normal;">Class <b>NestedSetChildExistsError</b></h3>
|
|
|
|
<p style="padding-left: 30px;"><i>Inherits from frappe.exceptions.ValidationError</i></h4>
|
|
|
|
<div class="docs-attr-desc"><p></p>
|
|
</div>
|
|
<div style="padding-left: 30px;">
|
|
|
|
</div>
|
|
<hr>
|
|
|
|
|
|
|
|
|
|
|
|
<h3 style="font-weight: normal;">Class <b>NestedSetInvalidMergeError</b></h3>
|
|
|
|
<p style="padding-left: 30px;"><i>Inherits from frappe.exceptions.ValidationError</i></h4>
|
|
|
|
<div class="docs-attr-desc"><p></p>
|
|
</div>
|
|
<div style="padding-left: 30px;">
|
|
|
|
</div>
|
|
<hr>
|
|
|
|
|
|
|
|
|
|
|
|
<h3 style="font-weight: normal;">Class <b>NestedSetMultipleRootsError</b></h3>
|
|
|
|
<p style="padding-left: 30px;"><i>Inherits from frappe.exceptions.ValidationError</i></h4>
|
|
|
|
<div class="docs-attr-desc"><p></p>
|
|
</div>
|
|
<div style="padding-left: 30px;">
|
|
|
|
</div>
|
|
<hr>
|
|
|
|
|
|
|
|
|
|
|
|
<h3 style="font-weight: normal;">Class <b>NestedSetRecursionError</b></h3>
|
|
|
|
<p style="padding-left: 30px;"><i>Inherits from frappe.exceptions.ValidationError</i></h4>
|
|
|
|
<div class="docs-attr-desc"><p></p>
|
|
</div>
|
|
<div style="padding-left: 30px;">
|
|
|
|
</div>
|
|
<hr>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<p class="docs-attr-name">
|
|
<a name="frappe.utils.nestedset.get_ancestors_of" href="#frappe.utils.nestedset.get_ancestors_of" class="text-muted small">
|
|
<i class="icon-link small" style="color: #ccc;"></i></a>
|
|
frappe.utils.nestedset.<b>get_ancestors_of</b>
|
|
<i class="text-muted">(doctype, name)</i>
|
|
</p>
|
|
<div class="docs-attr-desc"><p>Get ancestor elements of a DocType with a tree structure</p>
|
|
</div>
|
|
<br>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<p class="docs-attr-name">
|
|
<a name="frappe.utils.nestedset.get_root_of" href="#frappe.utils.nestedset.get_root_of" class="text-muted small">
|
|
<i class="icon-link small" style="color: #ccc;"></i></a>
|
|
frappe.utils.nestedset.<b>get_root_of</b>
|
|
<i class="text-muted">(doctype)</i>
|
|
</p>
|
|
<div class="docs-attr-desc"><p>Get root element of a DocType with a tree structure</p>
|
|
</div>
|
|
<br>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<p class="docs-attr-name">
|
|
<a name="frappe.utils.nestedset.rebuild_node" href="#frappe.utils.nestedset.rebuild_node" class="text-muted small">
|
|
<i class="icon-link small" style="color: #ccc;"></i></a>
|
|
frappe.utils.nestedset.<b>rebuild_node</b>
|
|
<i class="text-muted">(doctype, parent, left, parent_field)</i>
|
|
</p>
|
|
<div class="docs-attr-desc"><p>reset lft, rgt and recursive call for all children</p>
|
|
</div>
|
|
<br>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<p class="docs-attr-name">
|
|
<a name="frappe.utils.nestedset.rebuild_tree" href="#frappe.utils.nestedset.rebuild_tree" class="text-muted small">
|
|
<i class="icon-link small" style="color: #ccc;"></i></a>
|
|
frappe.utils.nestedset.<b>rebuild_tree</b>
|
|
<i class="text-muted">(doctype, parent_field)</i>
|
|
</p>
|
|
<div class="docs-attr-desc"><p>call rebuild_node for all root nodes</p>
|
|
</div>
|
|
<br>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<p class="docs-attr-name">
|
|
<a name="frappe.utils.nestedset.update_add_node" href="#frappe.utils.nestedset.update_add_node" class="text-muted small">
|
|
<i class="icon-link small" style="color: #ccc;"></i></a>
|
|
frappe.utils.nestedset.<b>update_add_node</b>
|
|
<i class="text-muted">(doc, parent, parent_field)</i>
|
|
</p>
|
|
<div class="docs-attr-desc"><p>insert a new node</p>
|
|
</div>
|
|
<br>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<p class="docs-attr-name">
|
|
<a name="frappe.utils.nestedset.update_move_node" href="#frappe.utils.nestedset.update_move_node" class="text-muted small">
|
|
<i class="icon-link small" style="color: #ccc;"></i></a>
|
|
frappe.utils.nestedset.<b>update_move_node</b>
|
|
<i class="text-muted">(doc, parent_field)</i>
|
|
</p>
|
|
<div class="docs-attr-desc"><p><span class="text-muted">No docs</span></p>
|
|
</div>
|
|
<br>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<p class="docs-attr-name">
|
|
<a name="frappe.utils.nestedset.update_nsm" href="#frappe.utils.nestedset.update_nsm" class="text-muted small">
|
|
<i class="icon-link small" style="color: #ccc;"></i></a>
|
|
frappe.utils.nestedset.<b>update_nsm</b>
|
|
<i class="text-muted">(doc)</i>
|
|
</p>
|
|
<div class="docs-attr-desc"><p><span class="text-muted">No docs</span></p>
|
|
</div>
|
|
<br>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<p class="docs-attr-name">
|
|
<a name="frappe.utils.nestedset.validate_loop" href="#frappe.utils.nestedset.validate_loop" class="text-muted small">
|
|
<i class="icon-link small" style="color: #ccc;"></i></a>
|
|
frappe.utils.nestedset.<b>validate_loop</b>
|
|
<i class="text-muted">(doctype, name, lft, rgt)</i>
|
|
</p>
|
|
<div class="docs-attr-desc"><p>check if item not an ancestor (loop)</p>
|
|
</div>
|
|
<br>
|
|
|
|
|
|
|
|
|
|
|
|
<!-- autodoc --> |