diff options
author | Ryan Petrello <lists@ryanpetrello.com> | 2010-12-22 15:26:01 -0500 |
---|---|---|
committer | Ryan Petrello <lists@ryanpetrello.com> | 2010-12-22 15:26:01 -0500 |
commit | bfc0689b768591aad9ce323f583b94d6df6e2ebd (patch) | |
tree | 81c4ab7aef61f76a569f04b55584294bda9b0d3f | |
parent | 3515a8bcd85fd2f0232070da8495e0db46410e77 (diff) | |
download | pecan-bfc0689b768591aad9ce323f583b94d6df6e2ebd.tar.gz |
Adding a `controller` reference to the state object that gets passed to hooks. This will allow implementations of PecanHook to have access to the controller that was routed to for the current request.
-rw-r--r-- | pecan/pecan.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/pecan/pecan.py b/pecan/pecan.py index 1ae605c..a45e989 100644 --- a/pecan/pecan.py +++ b/pecan/pecan.py @@ -156,6 +156,9 @@ class Pecan(MonitorableProcess): im_self = controller.im_self handlers = controller.pecan['generic_handlers'] controller = handlers.get(request.method, handlers['DEFAULT']) + + # add the controller to the state so that hooks can use it + state.controller = controller # determine content type if content_type is None: |