navigation.py 文件源码

python
阅读 24 收藏 0 点赞 0 评论 0

项目:pycroft 作者: agdsn 项目源码 文件源码
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
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号