From 6363eeb18b026bcb33121bab5f5e8cfcba41a3f9 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Fri, 9 Oct 2009 18:16:04 +0000 Subject: view -> static directive. --- docs/tutorials/bfgwiki/authorization.rst | 7 ------- docs/tutorials/bfgwiki/definingviews.rst | 6 +----- docs/tutorials/bfgwiki/viewdecorators.rst | 34 ++----------------------------- 3 files changed, 3 insertions(+), 44 deletions(-) (limited to 'docs/tutorials') diff --git a/docs/tutorials/bfgwiki/authorization.rst b/docs/tutorials/bfgwiki/authorization.rst index a736b7faa..444a0e5db 100644 --- a/docs/tutorials/bfgwiki/authorization.rst +++ b/docs/tutorials/bfgwiki/authorization.rst @@ -168,13 +168,6 @@ To protect each of our views with a particular permission, we need to pass a ``permission`` argument to each of our ``bfg_view`` decorators. To do so, within ``views.py``: -- We add ``permission='view'`` to the ``bfg_view`` decorator attached - to the ``static_view`` view function. This makes the assertion that - only users who possess the effective ``view`` permission at the time - of the request may invoke this view. We've granted ``Everyone`` the - view permission at the root model via its ACL, so everyone will be - able to invoke the ``static_view`` view. - - We add ``permission='view'`` to the ``bfg_view`` decorator attached to the ``view_wiki`` view function. This makes the assertion that only users who possess the effective ``view`` permission at the time diff --git a/docs/tutorials/bfgwiki/definingviews.rst b/docs/tutorials/bfgwiki/definingviews.rst index 1519bedab..53578e90f 100644 --- a/docs/tutorials/bfgwiki/definingviews.rst +++ b/docs/tutorials/bfgwiki/definingviews.rst @@ -259,11 +259,7 @@ Mapping Views to URLs in ``configure.zcml`` The ``configure.zcml`` file contains ``view`` declarations which serve to map URLs (via :term:`traversal`) to view functions. You'll need to -add five ``view`` declarations to ``configure.zcml``. - -#. Add a declaration which maps the "Wiki" class in our ``models.py`` - file to the view named ``static_view`` in our ``views.py`` file with - the view name ``static``. +add four ``view`` declarations to ``configure.zcml``. #. Add a declaration which maps the "Wiki" class in our ``models.py`` file to the view named ``view_wiki`` in our ``views.py`` file with diff --git a/docs/tutorials/bfgwiki/viewdecorators.rst b/docs/tutorials/bfgwiki/viewdecorators.rst index dc0e500eb..c0414a36e 100644 --- a/docs/tutorials/bfgwiki/viewdecorators.rst +++ b/docs/tutorials/bfgwiki/viewdecorators.rst @@ -18,9 +18,8 @@ Adding View Decorators We're going to import the ``bfg_view`` callable from the ``repoze.bfg.view`` module. This callable can be used as a function -decorator. We'll use it to decorate our ``static_view``, -``view_wiki``, ``view_page``, ``add_page`` and ``edit_page`` view -functions. +decorator. We'll use it to decorate our ``view_wiki``, ``view_page``, +``add_page`` and ``edit_page`` view functions. The ``bfg_view`` callable accepts a number of arguments: @@ -35,35 +34,6 @@ The ``bfg_view`` callable accepts a number of arguments: There are other arguments which this callable accepts, but these are the ones we're going to use. -The ``static_view`` view function ---------------------------------- - -Because our ``bfg_view`` decorator can only decorate view functions -and classes (not instances), we rename our ``static_view`` to -``static_app`` and create a new function named ``static_view`` which -simply calls ``static_app`` with the context and request. We decorate -the resulting ``static_view`` function with the following: - -.. code-block:: python - :linenos: - - @bfg_view(for_=Wiki, name='static') - -This indicates that the view is "for" the Wiki class and has the -view_name ``static``. After injecting this decorator, we can now -*remove* the following from our ``configure.zcml`` file: - -.. code-block:: xml - :linenos: - - - -Our decorator takes its place. - The ``view_wiki`` view function ------------------------------- -- cgit v1.2.3