You can do

from gluon.template import render

The render function is documented 
here: https://github.com/web2py/web2py/blob/master/gluon/template.py#L837

You can also use response.render(view,vars) instead of 
render(filename=view,context=vars)

On Sunday, 3 June 2012 23:10:33 UTC-5, Alec Taylor wrote:
>
> I'm intrigued... you've piqued my interest. 
>
> Can you show me an example with a few more lines so I can see where 
> you were going with this? 
>
> Thanks 
>
> On Mon, Jun 4, 2012 at 1:34 PM, Massimo Di Pierro 
> <massimo.dipie...@gmail.com> wrote: 
> > If I understand your question. You can do 
> > 
> > return response.render(view, context=dict()) 
> > 
> > 
> > On Sunday, 3 June 2012 21:57:59 UTC-5, Alec Taylor wrote: 
> >> 
> >> Would it be possible to decouple web2py templates to use REST 
> >> (HTTP)[XML, CSV, JSON] or RPC (XML, JSON)? 
> >> 
> >> The primary advantages I see for this is in the simplification for the 
> >> creation of: 
> >> - Mobile apps (using PhoneGap) 
> >> - Easy JavaScript widget extrapolation (Facebook/DISQUS/Twitter style) 
> >> 
> >> Please tell me if it's possible to decouple the templates, and if so, 
> how. 
> >> 
> >> Thanks for all information, 
> >> 
> >> Alec Taylor 
> >> 
> >> PS: If it's not possible with web2py templates, is there a different 
> >> Python template library which makes this possible? 
>

Reply via email to