Skip to content
Snippets Groups Projects
Commit 88374839 authored by LE GAC Renaud's avatar LE GAC Renaud
Browse files

Review navtree.py documentation.

parent 49296ae4
No related branches found
No related tags found
No related merge requests found
plugin_dbui.navtree.Node.add_child
==================================
.. currentmodule:: plugin_dbui.navtree
.. automethod:: Node.add_child
\ No newline at end of file
plugin_dbui.navtree.Node.add_children
=====================================
.. currentmodule:: plugin_dbui.navtree
.. automethod:: Node.add_children
\ No newline at end of file
plugin_dbui.navtree.Node.get_node
=================================
.. currentmodule:: plugin_dbui.navtree
.. automethod:: Node.get_node
\ No newline at end of file
plugin_dbui.navtree.Node.sort_children
======================================
.. currentmodule:: plugin_dbui.navtree
.. automethod:: Node.sort_children
\ No newline at end of file
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
......@@ -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::
......
......@@ -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}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment