diff options
author | Jonathan LaCour <jonathan@cleverdevil.org> | 2010-11-18 12:36:26 -0500 |
---|---|---|
committer | Jonathan LaCour <jonathan@cleverdevil.org> | 2010-11-18 12:36:26 -0500 |
commit | 03d89b7bd5cce3fcfdb48072f9f67c95bd7c00c9 (patch) | |
tree | 60dcebe3480be140374f60897ade960e3929c312 /pecan/decorators.py | |
parent | 98ef40daf8952027bd6392627c14e002f9494c86 (diff) | |
download | pecan-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.py | 3 |
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 |