diff options
| author | Chris McDonough <chrism@plope.com> | 2010-11-15 22:58:14 -0500 |
|---|---|---|
| committer | Chris McDonough <chrism@plope.com> | 2010-11-15 22:58:14 -0500 |
| commit | 36c1596c229bbaf7745c2a1f2c4dfcfdefb5535d (patch) | |
| tree | 28c246d9a73d7cd366b746e23386ce58fd5ca027 | |
| parent | 9e2e1cfa5d7b00b952b79a628347a89d2263f777 (diff) | |
| download | pyramid-36c1596c229bbaf7745c2a1f2c4dfcfdefb5535d.tar.gz pyramid-36c1596c229bbaf7745c2a1f2c4dfcfdefb5535d.tar.bz2 pyramid-36c1596c229bbaf7745c2a1f2c4dfcfdefb5535d.zip | |
docs backrefs
| -rw-r--r-- | pyramid/url.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/pyramid/url.py b/pyramid/url.py index b740aaca7..fa15e6364 100644 --- a/pyramid/url.py +++ b/pyramid/url.py @@ -18,6 +18,9 @@ def route_url(route_name, request, *elements, **kw): """Generates a fully qualified URL for a named :app:`Pyramid` :term:`route configuration`. + .. note:: Calling :meth:`pyramid.Request.route_url` can be used to + achieve the same result as :func:`pyramid.url.route_url`. + Use the route's ``name`` as the first positional argument. Use a request object as the second positional argument. Additional positional arguments are appended to the URL as path segments @@ -102,6 +105,7 @@ def route_url(route_name, request, *elements, **kw): If the route object which matches the ``route_name`` argument has a :term:`pregenerator`, the ``*elements`` and ``**kw`` arguments arguments passed to this function might be augmented or changed. + """ try: reg = request.registry @@ -157,6 +161,9 @@ def model_url(model, request, *elements, **kw): overall result of this function is always a UTF-8 encoded string (never Unicode). + .. note:: Calling :meth:`pyramid.Request.model_url` can be used to + achieve the same result as :func:`pyramid.url.model_url`. + Examples:: model_url(context, request) => @@ -270,6 +277,9 @@ def static_url(path, request, **kw): :term:`configuration declaration` or the ``<static>`` ZCML directive (see :ref:`static_resources_section`). + .. note:: Calling :meth:`pyramid.Request.static_url` can be used to + achieve the same result as :func:`pyramid.url.static_url`. + Example:: static_url('mypackage:static/foo.css', request) => |
