Skip to content

Commit

Permalink
docs: more usage examples
Browse files Browse the repository at this point in the history
  • Loading branch information
ergo committed Nov 19, 2016
1 parent d3f9aba commit f68aba9
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions docs/usage_examples.rst
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,20 @@ Create a new resource and place it somewhere:
resource_id=resource.resource_id, to_position=total_children,
db_session=self.request.dbsession)
Fetch all resources that are parent of resource:

.. code-block:: python
tree_service.path_upper(resource.resource_id, db_session=db_session)
Fetch all children of a resource limiting the amount of levels to go down,
then build a nested dictionary structure out of it:

.. code-block:: python
result = tree_service.from_resource_deeper(
resource_id, limit_depth=2, db_session=db_session)
tree_struct = tree_service.build_subtree_strut(result)
Delete some resource and all its descendants:

Expand Down

0 comments on commit f68aba9

Please sign in to comment.