Thank you very much for the reply it has been very helpful. Is this a good idea, what I am trying to do here. I am trying to create a simple Content Management System, and I want certain pages created in the database, to be automatically assigned with their own template. Manually creating a view for each page would be rather tedious wouldn't it?
On Feb 24, 8:36 pm, Chris McDonough <chr...@plope.com> wrote: > 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 pylons-devel@googlegroups.com. To unsubscribe from this group, send email to pylons-devel+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/pylons-devel?hl=en.