From 8dedfad9e666bccc84c52d1440e8acf9bff215e3 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Mon, 2 Nov 2009 03:02:35 +0000 Subject: --- docs/whatsnew-1.1.rst | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) (limited to 'docs') diff --git a/docs/whatsnew-1.1.rst b/docs/whatsnew-1.1.rst index f1cdc3b2c..e84d38a13 100644 --- a/docs/whatsnew-1.1.rst +++ b/docs/whatsnew-1.1.rst @@ -409,7 +409,7 @@ hardcode path values in template URLs. The view machinery defaults to using the ``__call__`` method of the view callable (or the function itself, if the view callable is a -function) to obtain a response dictionary. +function) to obtain a response. In :mod:`repoze.bfg` 1.1, the ``attr`` view configuration value allows you to vary the attribute of a view callable used to obtain the @@ -421,7 +421,32 @@ For example, if your view is a class, and the class has a method named in the view configuration for the view. Specifying ``attr`` is most useful when the view definition is a -class. +class. For example: + +.. code-block:: xml + :linenos: + + + +The referenced ``MyViewClass`` might look like so: + +.. code-block:: python + :linenos: + + from webob import Response + + class MyViewClass(object): + def __init__(context, request): + self.context = context + self.request = request + + def index(self): + return Response('OK') + +The ``index`` method of the class will be used to obtain a response. ``@bfg_view`` Decorators May Now Be Stacked ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -- cgit v1.2.3