From 8e4f1b316a7d4d8a611d71420c93cef58cf444c2 Mon Sep 17 00:00:00 2001 From: Casey Duncan Date: Wed, 8 Dec 2010 21:42:37 -0800 Subject: clarify paragraphs about traversal context --- docs/narr/static.rst | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'docs') 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. -- cgit v1.2.3