navibar.py 文件源码

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

项目:railgun 作者: xin-xinhanggao 项目源码 文件源码
def make_view(title, endpoint, *args, **kwargs):
        """A shortcut to make a :class:`NaviItem` linking to a standard
        Flask view.  Equal to the following statement:

        .. code-block:: python

            NaviItem(
                title=title,
                url=lambda: url_for(endpoint, *args, **kwargs),
                identity=endpoint
            )

        :param title: The title of new :class:`NaviItem`
        :param endpoint: The endpoint of target view.
        :type endpoint: :class:`str`
        :param args: The unnamed arguments to :func:`flask.url_for` when
            generating the `url`.
        :param kwargs: The named arguments to :func:`flask.url_for` when
            generating the `url`.
        """
        return NaviItem(title, lambda: url_for(endpoint, *args, **kwargs),
                        endpoint)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号