(機械翻訳) pyramid.url

ピラミッドのURLを扱うためのユーティリティ関数

resource_url(resource, request, *elements, **kw)[ソース]

これは下位互換性の機能です。その結果は次の呼び出しと同じです:

request.resource_url(resource, *elements, **kw)

詳細は、meth: `pyramid.request.Request.resource_url`を参照してください。

route_url(route_name, request, *elements, **kw)[ソース]

これは下位互換性の機能です。その結果は次の呼び出しと同じです:

request.route_url(route_name, *elements, **kw)

詳細は、meth: `pyramid.request.Request.route_url`を参照してください。

current_route_url(request, *elements, **kw)[ソース]

これは下位互換性の機能です。その結果は次の呼び出しと同じです:

request.current_route_url(*elements, **kw)

詳細は、meth: `pyramid.request.Request.current_route_url`を参照してください。

route_path(route_name, request, *elements, **kw)[ソース]

これは下位互換性の機能です。その結果は次の呼び出しと同じです:

request.route_path(route_name, *elements, **kw)

詳細は、:meth: `pyramid.request.Request.route_path`を参照してください。

current_route_path(request, *elements, **kw)[ソース]

これは下位互換性の機能です。その結果は次の呼び出しと同じです:

request.current_route_path(*elements, **kw)

詳細は、:meth: `pyramid.request.Request.current_route_path`を参照してください。

static_url(path, request, **kw)[ソース]

これは下位互換性の機能です。その結果は次の呼び出しと同じです:

request.static_url(path, **kw)

詳細は、meth: `pyramid.request.Request.static_url`を参照してください。

static_path(path, request, **kw)[ソース]

これは下位互換性の機能です。その結果は次の呼び出しと同じです:

request.static_path(path, **kw)

詳細は、meth: `pyramid.request.Request.static_path`を参照してください。

urlencode(query, doseq=True, quote_via=<function quote_plus>)[ソース]

Pythonのstdlib:func: urllib.parse.urlencode`関数の別の実装で、 query` dict / sequence内のユニコードキーと値を受け取ります。すべてのUnicodeキーと値は、最初にUTF-8に変換されてから、クエリ文字列を作成するために使用されます。

The value of query must be a sequence of two-tuples representing key/value pairs or an object (often a dictionary) with an .items() method that returns a sequence of two-tuples representing key/value pairs.

For minimal calling convention backwards compatibility, this version of urlencode accepts but ignores a second argument conventionally named doseq. The Python stdlib version behaves differently when doseq is False and when a sequence is presented as one of the values. This version always behaves in the doseq=True mode, no matter what the value of the second argument.

Both the key and value are encoded using the quote_via function which by default is using a similar algorithm to urllib.parse.quote_plus() which converts spaces into '+' characters and '/' into '%2F'.

バージョン 1.5 で変更: In a key/value pair, if the value is None then it will be dropped from the resulting output.

バージョン 1.9 で変更: Added the quote_via argument to allow alternate quoting algorithms to be used.