Hey folks, in the what's new for 1.1 I found this:
In repoze.bfg 1.0, the @bfg_view decorator could not be used on class
methods. In 1.1, the @bfg_view decorator can be used against a class
from webob import Response
from repoze.bfg.view import bfg_view
def __init__(self, context, request):
self.context = context
self.request = request
return Response('hello from %s!' % self.context)
When the bfg_view decorator is used against a class method, a view is
registered for the class (it’s a “class view” where the “attr” happens
to be the name of the method it is attached to), so the class it’s
defined within must have a suitable constructor: one that accepts
context, request or just request.
Am I missing something terribly obvious, or is that not just a regular
instance method in the example? Or am I misunderstanding the point?
Perhaps this part could be clearer, it's confused me at any rate.
btw, the 1.1 improvements are awesome.
Repoze-dev mailing list