On Aug 13, 3:12 pm, Matt Feifarek <[email protected]> wrote:

> I don't think that it should be anything special; they're just functions
> after all.
>
> So, something like this should work:
>
> def view1(request):
>     if [something something]:
>         return view2(request)
>     [other code here]
>     return Response("This is from view1")
>
> def view2(request):
>     return Response("This is from view2")


Yes, that works with no problems, but it becomes a problem when the
called view was view_configed with a renderer:

    @view_config(route_name="foo",
                 renderer="foo.jinja2")
    def foo_view(request):
        return {"whereami" : "foo!"}


    @view_config(route_name="bar")
    def bar_view(request):
       return foo_view(request)

Calling foo_view from bar_view returns a dictionary, not a Response.
In order for bar_view to use this, it would have to know what renderer
to run it through.  This piece of information (the renderer) would
need to be duplicated in both foo_view and bar_view.

-- 
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en.

Reply via email to