summaryrefslogtreecommitdiff
path: root/repoze
diff options
context:
space:
mode:
authorChris McDonough <chrism@agendaless.com>2009-11-11 19:26:25 +0000
committerChris McDonough <chrism@agendaless.com>2009-11-11 19:26:25 +0000
commitc8d6ab1c3dff10ea2151c6ee777dcf75ab84ee08 (patch)
treea38e0d3766b31eaf1d2b362ddb79dd407dc51dbb /repoze
parentdc78a51ee68448dff02ba02bf00c75429dd051a6 (diff)
downloadpyramid-c8d6ab1c3dff10ea2151c6ee777dcf75ab84ee08.tar.gz
pyramid-c8d6ab1c3dff10ea2151c6ee777dcf75ab84ee08.tar.bz2
pyramid-c8d6ab1c3dff10ea2151c6ee777dcf75ab84ee08.zip
- Add examples to ``repoze.bfg.url.model_url`` docstring.
Diffstat (limited to 'repoze')
-rw-r--r--repoze/bfg/url.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/repoze/bfg/url.py b/repoze/bfg/url.py
index d6f7970e5..746713563 100644
--- a/repoze/bfg/url.py
+++ b/repoze/bfg/url.py
@@ -132,6 +132,24 @@ def model_url(model, request, *elements, **kw):
context of a URL dispatch; contexts found this way do not need
to be location-aware.
+ Examples::
+
+ model_url(context, request) =>
+
+ http://example.com/
+
+ model_url(context, request, 'a.html') =>
+
+ http://example.com/a.html
+
+ model_url(context, request, 'a.html', query={'q':'1'}) =>
+
+ http://example.com/a.html?q=1
+
+ model_url(context, request, 'a.html', anchor='abc') =>
+
+ http://example.com/#abc
+
Any positional arguments passed in as ``elements`` must be strings
or unicode objects. These will be joined by slashes and appended
to the generated model URL. Each of the elements passed in is