Hi all,

Without the usual Pylons globals, does this look like a sane way to do
Pylons-style rendering of templates from handlers? Specifically, the
use of the superclass with self.render and self.c.

N

from pyramid import renderers

class Handler(object):
    def __init__(self, request):
        self.request = request
        self.c = self.request.tmpl_context

    def render(self, renderer_name):
        return renderers.render_to_response(renderer_name, {},
self.request)

class HomeHandler(Handler):
    def index(self):
        self.c.foo = 'bar'
        return self.render('/index.mako')

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