summaryrefslogtreecommitdiff
path: root/CHANGES.txt
diff options
context:
space:
mode:
authorChris McDonough <chrism@agendaless.com>2009-10-18 05:50:54 +0000
committerChris McDonough <chrism@agendaless.com>2009-10-18 05:50:54 +0000
commit1dc3907e59995852d5ee0251c1c92a360f03ed35 (patch)
tree38da7879503f2b55b995cee89a2aebe6c7d6f076 /CHANGES.txt
parent2cce431f02a37c119eacfc3dfa94af9fe3305de1 (diff)
downloadpyramid-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 'CHANGES.txt')
-rw-r--r--CHANGES.txt19
1 files changed, 19 insertions, 0 deletions
diff --git a/CHANGES.txt b/CHANGES.txt
index b9de23d9f..b700aaed5 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -19,6 +19,25 @@ Features
This makes it possible to associate more than one view configuration
for a single callable without requiring ZCML.
+- 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.
+
1.1a6 (2009-10-15)
==================