diff --git a/docs/api/generated/navtree/plugin_dbui.navtree.Node.add_child.rst b/docs/api/generated/navtree/plugin_dbui.navtree.Node.add_child.rst new file mode 100644 index 0000000000000000000000000000000000000000..881a3adbab069ca36d7342033055466a07a9ce73 --- /dev/null +++ b/docs/api/generated/navtree/plugin_dbui.navtree.Node.add_child.rst @@ -0,0 +1,6 @@ +plugin_dbui.navtree.Node.add_child +================================== + +.. currentmodule:: plugin_dbui.navtree + +.. automethod:: Node.add_child \ No newline at end of file diff --git a/docs/api/generated/navtree/plugin_dbui.navtree.Node.add_children.rst b/docs/api/generated/navtree/plugin_dbui.navtree.Node.add_children.rst new file mode 100644 index 0000000000000000000000000000000000000000..c718da0c7230fd173d5d79556e429cf877cb0dae --- /dev/null +++ b/docs/api/generated/navtree/plugin_dbui.navtree.Node.add_children.rst @@ -0,0 +1,6 @@ +plugin_dbui.navtree.Node.add_children +===================================== + +.. currentmodule:: plugin_dbui.navtree + +.. automethod:: Node.add_children \ No newline at end of file diff --git a/docs/api/generated/navtree/plugin_dbui.navtree.Node.get_node.rst b/docs/api/generated/navtree/plugin_dbui.navtree.Node.get_node.rst new file mode 100644 index 0000000000000000000000000000000000000000..f188393a686e943805f9cb548753b7c0008bc31d --- /dev/null +++ b/docs/api/generated/navtree/plugin_dbui.navtree.Node.get_node.rst @@ -0,0 +1,6 @@ +plugin_dbui.navtree.Node.get_node +================================= + +.. currentmodule:: plugin_dbui.navtree + +.. automethod:: Node.get_node \ No newline at end of file diff --git a/docs/api/generated/navtree/plugin_dbui.navtree.Node.sort_children.rst b/docs/api/generated/navtree/plugin_dbui.navtree.Node.sort_children.rst new file mode 100644 index 0000000000000000000000000000000000000000..47204a794235573ad85cf745726491d102ab44f5 --- /dev/null +++ b/docs/api/generated/navtree/plugin_dbui.navtree.Node.sort_children.rst @@ -0,0 +1,6 @@ +plugin_dbui.navtree.Node.sort_children +====================================== + +.. currentmodule:: plugin_dbui.navtree + +.. automethod:: Node.sort_children \ No newline at end of file diff --git a/docs/api/generated/plugin_dbui.navtree.Node.rst b/docs/api/generated/plugin_dbui.navtree.Node.rst new file mode 100644 index 0000000000000000000000000000000000000000..cd958b23cf2312ba6cbdae416f28055b1ff05abd --- /dev/null +++ b/docs/api/generated/plugin_dbui.navtree.Node.rst @@ -0,0 +1,21 @@ +plugin_dbui.navtree.Node +======================== + +.. currentmodule:: plugin_dbui.navtree + +.. autoclass:: Node + + .. rubric:: Methods + + .. autosummary:: + :toctree: navtree/ + + ~Node.add_child + ~Node.add_children + ~Node.get_node + ~Node.sort_children + + + + + diff --git a/docs/api/user_interface.rst b/docs/api/user_interface.rst index 0e7cdb91e4e9c45888924540158f639944b244f2..a6051430078f542d1d081faf09ca5c775e0971ff 100644 --- a/docs/api/user_interface.rst +++ b/docs/api/user_interface.rst @@ -43,6 +43,16 @@ Grid configure_grids GridModifier +Node +^^^^ + +.. currentmodule:: plugin_dbui.navtree + +.. autosummary:: + :toctree: generated/ + + Node + Store ^^^^^ @@ -57,13 +67,6 @@ Store Viewport ^^^^^^^^ -.. currentmodule:: plugin_dbui.navtree - -.. autosummary:: - :toctree: generated/ - - Node - .. currentmodule:: plugin_dbui.viewportmodifier .. autosummary:: diff --git a/modules/plugin_dbui/navtree.py b/modules/plugin_dbui/navtree.py index 66080d92c0d74b1792142938b1a28ee06e353bdf..25c027ed448405945fde8f6d939dce012b26cd5a 100644 --- a/modules/plugin_dbui/navtree.py +++ b/modules/plugin_dbui/navtree.py @@ -7,23 +7,22 @@ from gluon import current class Node(object): - """The ``node`` is the key element of the navigation tree. + """The *node* is the key element of the navigation tree. It contains children (leaves) which are associated to widgets. The widget will be display on the panel of the *Viewport*. + Args: + text (str): name of the node appearing in the viewport + navigation tree. + Attributes: - text (str) - children (list) - hidden (list) + text (str): name of the node + children (list): list of children + hidden (list): list of children to be hidden """ def __init__(self, text): - """Construct the node. - - Args: - text (str): name of the node appearing in the viewport - """ self.text = text self.children = [] self.hidden = [] @@ -49,14 +48,14 @@ class Node(object): """Add children (leaves) to the node. Args: - leaves (list): a list of string + leaves (list): names of the leaves func (function): - function translating the leaf name into + function mapping the leaf name to the Ext JS configuration options dictionary. The latter defines the associated widget. - hidden (list): list of children to be hidden. + hidden (list): list of children to be ignored. Note: * Leaf names are translated in the current language @@ -89,9 +88,14 @@ class Node(object): Returns: dict: - * ``text`` (str): name of the node - * ``children`` (list): list of dictionary containing - Ext JS configuration for the widgets associated to the leaves. + * **text** (str): name of the node + * **children** (list): list of leaves. Each element is + a dictionary with three keys: + + * **cfg** (dict): configuration for the widgets + associated to the leaf. + * **leave** (bool): always ``True``. + * **text** (str): name of the leaf """ return {'text': self.text, 'children': self.children}