page=response.render(cStringIO.StringIO('{{for i in range(n):}}
<h1>Hello World</h1>{{pass}}',n=10)

On Sep 24, 11:40 am, leone <[email protected]> wrote:
> Does not exist a function that compile a view passed as a string and
> return a rendered page.
> Is it possible?
> -leone
>
> On Sep 24, 4:29 pm, DenesL <[email protected]> wrote:
>
> > Hi leone,
>
> > if you want to use the {{=var}} syntax then the easiest way to go is
> > with a view.
>
> > An alternative would be to use string formatting with a dictionary as
> > explained in the Python 2.5 help file, section 3.6.2:
>
> > >>> print '%(language)s has %(#)03d quote types.' % \
>
> >           {'language': "Python", "#": 2}
> > Python has 002 quote types.
>
> > and return the created string instead of a dictionary in your
> > controller (just remember to add all the proper HTML code around it
> > too).
>
> > DenesL
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py-users" 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/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to