diff options
| author | Chris McDonough <chrism@agendaless.com> | 2009-10-18 05:50:54 +0000 |
|---|---|---|
| committer | Chris McDonough <chrism@agendaless.com> | 2009-10-18 05:50:54 +0000 |
| commit | 1dc3907e59995852d5ee0251c1c92a360f03ed35 (patch) | |
| tree | 38da7879503f2b55b995cee89a2aebe6c7d6f076 /docs/tutorials | |
| parent | 2cce431f02a37c119eacfc3dfa94af9fe3305de1 (diff) | |
| download | pyramid-1dc3907e59995852d5ee0251c1c92a360f03ed35.tar.gz pyramid-1dc3907e59995852d5ee0251c1c92a360f03ed35.tar.bz2 pyramid-1dc3907e59995852d5ee0251c1c92a360f03ed35.zip | |
- The ``@bfg_view`` decorator can now be used against a class method::
from webob import Response
from repoze.bfg.view import bfg_view
class MyView(object):
def __init__(self, context, request):
self.context = context
self.request = request
@bfg_view(name='hello')
def amethod(self):
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 method they're attached to), so the view class
must have a suitable constructor.
Diffstat (limited to 'docs/tutorials')
0 files changed, 0 insertions, 0 deletions
