On Thu, 2011-02-24 at 12:13 -0800, AwaisMuzaffar wrote:
> Lets assume, I have the following route set up:
>
> config.add_route('pages', '/{page}/', view='testproject:views.pages',
> view_renderer='testproject:templates/page.mak')
>
> Would it be possible to make the template name e.g page.mak a variable
> that matches the name of the response path.
>
> something like: view_renderer = .. templates/{page}.mak
>
> So template name uses the path name.
>
> I hope you guys understand what I am getting at.
Sorry, no, you'll have to use:
pyramid.renderers.render_to_response('templates/%s.mak' %
request.matchdict['page'], values, request=request)
Within the view instead of putting a renderer declaration in the
decorator if you want to do this.
- C
--
You received this message because you are subscribed to the Google Groups
"pylons-devel" 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-devel?hl=en.