A new HostRequest type can be used to have the host framework request object passed to the exposed functions

This commit is contained in:
Christophe de Vienne
2013-04-02 16:19:30 +02:00
parent c1f08c40db
commit 83bc4b596b
8 changed files with 45 additions and 3 deletions

View File

@@ -65,6 +65,8 @@ def wsexpose(*args, **kwargs):
funcdef, args, kwargs, pecan.request.params, None,
pecan.request.body, pecan.request.content_type
)
if funcdef.pass_request:
kwargs[funcdef.pass_request] = pecan.request
result = f(self, *args, **kwargs)
except:
data = wsme.api.format_exception(sys.exc_info())