If you only need to render a template you can use tg.render.render and call it.
It will use the same configuration of tg to render your template.

Should be:
return render(dict(data=data), 'genshi', 'mytemplate')

On Fri, Sep 2, 2011 at 8:32 PM, biocode <[email protected]> wrote:
> Hi all,
>
> I'm trying to do something like this but don't know how to obtain a
> reference to the already configured genshi loader instance.
>
> @expose('json')
> def foo(self):
>    data = get_some_data()
>
>    tg_loader = some_magic_tg_code() #Please help with this
>
>    tmpl = tg_loader.load("mytemplate.tmpl")
>    return {'html': tmpl.generate(data=data).render('html')}
>
>
>
> Thanks for your help,
> Tony
>
> --
> You received this message because you are subscribed to the Google Groups 
> "TurboGears" 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/turbogears?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"TurboGears" 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/turbogears?hl=en.

Reply via email to