From af9006a8ecbff71df4fb7255873e3b7dcb737de8 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Thu, 13 Aug 2009 20:27:24 +0000 Subject: - Request-only-convention examples in the "Views" narrative documentation were broken. --- CHANGES.txt | 3 +++ docs/narr/views.rst | 14 +++++++------- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index ee231391f..0943070db 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,6 +1,9 @@ Next release ============ +- Request-only-convention examples in the "Views" narrative + documentation were broken. + - Change urldispatch internals: Route object is now constructed using a path, a name, and a factory instead of a name, a matcher, a generator, and a factory. diff --git a/docs/narr/views.rst b/docs/narr/views.rst index 6a7f0ac8b..b5db0ca63 100644 --- a/docs/narr/views.rst +++ b/docs/narr/views.rst @@ -91,27 +91,27 @@ following types work as views in this style: from webob import Response - def aview(request): + def view(request): return Response('OK') -#. New and old-style classes that have an ``__init__`` method that - accepts ``self, request``, e.g.:: +#. New-style and old-style classes that have an ``__init__`` method + that accepts ``self, request``, e.g.:: from webob import Response - def View(object): + class view(object): __init__(self, request): - return Response('OK') + return Response('OK') #. Arbitrary callables that have a ``__call__`` method that accepts ``self, request``, e.g.:: from webob import Response - def AView(object): + class View(object): def __call__(self, request): return Response('OK') - view = AView() + view = View() # this is the view callable This style of calling convention is useful for :term:`url dispatch` based applications, where the context is seldom used within the view -- cgit v1.2.3