tree
****
Use :class:`tree` for generate html tags for tree. in fact, this command use in hierarchy data.
.. code-block:: html
:linenos:
[...]
.. important::
The :class:`tree` command inherit from :doc:`renderable` base class.
Attributes:
===========
nullvalue :class:`string` :class:`optional` :class:`[##-notaion`
Determine null or empty value that determine root node on hierarchy.
value of column :class:`parentidcol` in root record must be set to :class:`nullvalue`.
default value for :class:`nullvalue` is :class:`0`.
idcol :class:`string` :class:`optional` :class:`[##-notaion`
Determine column name for primary-key or principal-key in data source that use for detect parent side of hierarchy relation.
default value for :class:`idcol` is :class:`id`.
parentidcol :class:`string` :class:`optional` :class:`[##-notaion`
Determine column name for foreign-key in data source that use for detect child side of hierarchy relation.
default value for :class:`parentidcol` is :class:`parentid`.
relationnamecol :class:`string` :class:`optional` :class:`[##-notaion` :class:`obsoleted`
Determine column name in data source that use for sort hierarchy output.
if not set, sorting is ignored.
.. note::
For see more Information about :class:`[##-notaion`,see :doc:`../[-sharp-sharp-notation`
Example
=======
1# Create simple command
------------------------
.. code-block:: html
:linenos:
@lname :
@fname - @lname
.. include:: /sample-code/sample-data.rst
:start-after: _db_users_start_
:end-before: _db_users_end_
Result is:
.. code-block:: html
:linenos:
-
qamsari :
- amir - jalali
- akbar - karimi