From 36c1596c229bbaf7745c2a1f2c4dfcfdefb5535d Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Mon, 15 Nov 2010 22:58:14 -0500 Subject: docs backrefs --- pyramid/url.py | 10 ++++++++++ 1 file changed, 10 insertions(+) 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 ```` 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) => -- cgit v1.2.3