euphorie.client.navigation

euphorie.client.navigation.getTreeData(request, context, phase='identification', filter=None)

Assemble data for a navigation tree

This function returns a nested dictionary structure reflecting the elements for a navigation tree. The tree will all sibling questions of the current context, the current module and all its module siblings, its parents up to the root module, and all modules at the root level.

Optionally a SQLAlchemy clause can be provided, which will be used to filter items shown in the tree. The current item and its parents will always be shown.

Each element is reflect as a dictionary item with the following keys:

  • id: the SQL object id
  • type: the SQL object type
  • number: a human presentable numbering of the item
  • title: the object title
  • current: boolean indicating if this is the current context or its direct parent module
  • active: boolean indicating if this is a parent node of the current context
  • class: CSS classes to use for this node
  • children: a list of child nodes (in the right order)
  • url: URL for this item

Previous topic

euphorie.client.model

Next topic

euphorie.client.profile

This Page