Yes I understand if you have a view we can pass response using a
template. But was checking if there was a way to invoke a template
directly without having to route request to a view, like JSP (in
J2EE).

But I guess its not worth it.

On Jun 28, 11:27 am, Michael Merickel <[email protected]> wrote:
> All of Pyramid's template rendering is handled in the context of a request.
> This is primarily because the template lookup is handled through the
> registry which is attached to the request. If you have the registry, you can
> use pyramid.renderers.render() with a dummy request object in order to use
> the template directly (or if you are in a view, you may just pass in your
> current request object).
>
> I really don't understand your problem though... Pyramid uses views to
> handle requests, so given that, when you are in your view you may do
> whatever you want to return a valid pyramid.response.Response object. For
> example:
>
>     resp = Response()
>     resp.body = render('mytemplate.mako', {'param':
> request.params['some_request_param']}, request)
>     return resp
>
> --
>
> Michael

-- 
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