diff options
| author | Casey Duncan <casey.duncan@gmail.com> | 2010-12-08 21:42:37 -0800 |
|---|---|---|
| committer | Casey Duncan <casey.duncan@gmail.com> | 2010-12-08 21:42:37 -0800 |
| commit | 8e4f1b316a7d4d8a611d71420c93cef58cf444c2 (patch) | |
| tree | b756f4270857c41562c647e8535f4bc2588c3af7 /docs | |
| parent | c0c57f5f0db2f9693d0aac830b0e45ce99396133 (diff) | |
| download | pyramid-8e4f1b316a7d4d8a611d71420c93cef58cf444c2.tar.gz pyramid-8e4f1b316a7d4d8a611d71420c93cef58cf444c2.tar.bz2 pyramid-8e4f1b316a7d4d8a611d71420c93cef58cf444c2.zip | |
clarify paragraphs about traversal context
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/narr/static.rst | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/docs/narr/static.rst b/docs/narr/static.rst index e8e3fc843..3b495a6ae 100644 --- a/docs/narr/static.rst +++ b/docs/narr/static.rst @@ -234,13 +234,16 @@ represents your root object. config.add_view('mypackage.static.static_view', name='static', context='mypackage.models.Root') -In this case, ``mypackage.models.Root`` refers to the class of which your -:app:`Pyramid` application's root object is an instance. - -You can also omit the ``context`` argument if you want the name ``static`` to -be accessible as the static view against any model. This will also allow -``/static/foo.js`` to work, but it will allow for ``/anything/static/foo.js`` -too, as long as ``anything`` itself is resolvable. +In this case, ``mypackage.models.Root`` refers to the class of your +:app:`Pyramid` application's traversal root object. + +The context argument above limits where the static view is accessible to +URL paths directly under the root object. If you omit the ``context`` +argument, then ``static`` will be accessible as the static view against +any model object in the traversal graph. This will allow +``/static/foo.js`` to work, but it will also allow for +``/anything/static/foo.js`` too, as long as ``anything`` can be +resolved. Note that you cannot use the :func:`pyramid.url.static_url` API to generate URLs against resources made accessible by registering a custom static view. |
