namespaces.py 文件源码

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

项目:microcosm-flask 作者: globality-corp 项目源码 文件源码
def href_for(self, operation, qs=None, **kwargs):
        """
        Construct an full href for an operation against a resource.

        :parm qs: the query string dictionary, if any
        :param kwargs: additional arguments for path expansion

        """
        url = urljoin(request.url_root, self.url_for(operation, **kwargs))
        qs_character = "?" if url.find("?") == -1 else "&"

        return "{}{}".format(
            url,
            "{}{}".format(qs_character, urlencode(qs)) if qs else "",
        )
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号