Category Mapped Class
Return a list of ancestors, starting with the root node.
This method is optimized for when all categories have already been fetched in the current DBSession:
>>> Category.query.all() # run one query >>> row = Category.query.get(50) # doesn't use a query >>> row.parent # the DBSession recognized the primary key <Category: parent> >>> print row.ancestors() [..., <Category: great-grand-parent>, <Category: grand-parent>, <Category: parent>]
Return this category’s distance from the root of the tree.
Return a list of descendants in depth-first order.
Iterate over all nested categories in depth-first order.