Re: Chaining of views using wrapper

2011-09-12 Thread Michael Merickel
1) What url are you visiting when you get the error? 2) There are no routes in play here, so I can't tell if your talk of using pyramid_handlers is a red herring, or the actual problem. Can you elaborate? And to clarify why I care, render_view_to_response (the underlying code behind wrapping

Re: Chaining of views using wrapper

2011-09-12 Thread Jay T
Here is the handler setup. config.add_handler('wrapper','/test_wrapper/{action}',handler=TestWrapper) config.add_handler('wrapped','/test_wrapper/{action}',handler=TestWrapper) Here is the handler code: class TestWrapper(BaseView):

Re: Chaining of views using wrapper

2011-09-12 Thread Michael Merickel
As I said in my previous reply, the wrapped views do not work with routes, only with traversal. Thus they will not work with handlers, which are an abstraction on top of routes. Pyramid does not have a public api for invoking other views during a request. Instead it provides a very extensible

Re: Chaining of views using wrapper

2011-09-12 Thread Jay T
I happened to read your blog : http://michael.merickel.org/2011/8/23/outgrowing-pyramid-handlers/ I think the match_param view predicate works great for what I really want to achieve. I can have one route with multiple views defined and have the request routed based on the match_param view

Re: Chaining of views using wrapper

2011-09-12 Thread Michael Merickel
No problem. I feel obligated to mention however that pyramid_handlers works fine for this case as well. You can decorate multiple methods with the same name but different predicates. For example: class MyHandler(object): def __init__(self, request): self.request = request

Chaining of views using wrapper

2011-09-11 Thread Jay T
Can someone please provide a simple example of view chaining using wrapper argument in View Config ? I am using pyramid_handlers for route/view declaration. I think I am missing something simple but shouldn't this work: @view_config(name='wrapped',wrapper='wrapper',renderer='string') def