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. --- docs/narr/views.rst | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'docs') 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