def navigate(self, text, description=None):
"""A decorator to add a navigation menu entry for the actual view func.
This is a decorator like the "route()" from `flask.Flask` or
`flask.Blueprint`. It register a navigation menu entry for the
current view function.
The text argument is used as menu-text and the description sets an
optional anchor-title.
:param text: The menu entry text.
:param description: a anchor title.
"""
def decorator(f):
element = self._navigation_item(
bake_endpoint(self.blueprint, f),
text,
description)
self._elements.append(element)
return f
return decorator
评论列表
文章目录