summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris McDonough <chrism@agendaless.com>2009-02-03 16:40:17 +0000
committerChris McDonough <chrism@agendaless.com>2009-02-03 16:40:17 +0000
commit00390896683d497cd8e6855727c3e6def3d20f82 (patch)
treed1bfa5be36182e3b12b78788ef4bd324830907d1
parent21ad665f64dbdba4e9e0bfaeecbf9ce576b82c73 (diff)
downloadpyramid-00390896683d497cd8e6855727c3e6def3d20f82.tar.gz
pyramid-00390896683d497cd8e6855727c3e6def3d20f82.tar.bz2
pyramid-00390896683d497cd8e6855727c3e6def3d20f82.zip
This confuses Sphinx.
-rw-r--r--repoze/bfg/url.py19
1 files changed, 9 insertions, 10 deletions
diff --git a/repoze/bfg/url.py b/repoze/bfg/url.py
index 5c520fe4a..99b4cdabf 100644
--- a/repoze/bfg/url.py
+++ b/repoze/bfg/url.py
@@ -5,7 +5,6 @@ import urllib
from zope.component import queryMultiAdapter
from repoze.bfg.interfaces import IContextURL
-from repoze.bfg.interfaces import VH_ROOT_KEY
def model_url(model, request, *elements, **kw):
"""
@@ -13,13 +12,13 @@ def model_url(model, request, *elements, **kw):
context) object based on the ``wsgi.url_scheme``, ``HTTP_HOST`` or
``SERVER_NAME`` in the request, plus any ``SCRIPT_NAME``. If a
'virtual root path' is present in the request environment (the
- value of the environ key ``%s``), and the ``model`` was obtained
- via traversal, the URL path will not include the virtual root
- prefix (it will be stripped out of the generated URL). If a
- ``query`` keyword argument is provided, a query string based on
- its value will be composed and appended to the generated URL
- string (see details below). The overall result of this function
- is always a UTF-8 encoded string (never unicode).
+ value of the WSGI environ key ``HTTP_X_VHM_ROOT``), and the
+ ``model`` was obtained via traversal, the URL path will not
+ include the virtual root prefix (it will be stripped out of the
+ generated URL). If a ``query`` keyword argument is provided, a
+ query string based on its value will be composed and appended to
+ the generated URL string (see details below). The overall result
+ of this function is always a UTF-8 encoded string (never unicode).
.. note:: If the ``model`` used is the result of a traversal, it
must be :term:`location`-aware. The 'model' can also be the
@@ -54,8 +53,8 @@ def model_url(model, request, *elements, **kw):
``True``. This means that sequences can be passed as
values, and a k=v pair will be placed into the query
string for each value.
- """ % VH_ROOT_KEY
-
+ """
+
context_url = queryMultiAdapter((model, request), IContextURL)
if context_url is None:
# b/w compat for unit tests