summaryrefslogtreecommitdiff
path: root/pecan/decorators.py
diff options
context:
space:
mode:
authorJonathan LaCour <jonathan@cleverdevil.org>2010-11-18 12:36:26 -0500
committerJonathan LaCour <jonathan@cleverdevil.org>2010-11-18 12:36:26 -0500
commit03d89b7bd5cce3fcfdb48072f9f67c95bd7c00c9 (patch)
tree60dcebe3480be140374f60897ade960e3929c312 /pecan/decorators.py
parent98ef40daf8952027bd6392627c14e002f9494c86 (diff)
downloadpecan-03d89b7bd5cce3fcfdb48072f9f67c95bd7c00c9.tar.gz
You no longer have to @expose() generic controller handlers. You can
simply pass through any keyword arguments you like, just as you would to @expose(). See tests for examples.
Diffstat (limited to 'pecan/decorators.py')
-rw-r--r--pecan/decorators.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/pecan/decorators.py b/pecan/decorators.py
index 6069e7c..0d15c15 100644
--- a/pecan/decorators.py
+++ b/pecan/decorators.py
@@ -6,8 +6,9 @@ def _cfg(f):
def when_for(controller):
- def when(method):
+ def when(method=None, **kw):
def decorate(f):
+ expose(**kw)(f)
_cfg(f)['generic_handler'] = True
controller.pecan['generic_handlers'][method.upper()] = f
return f