Render is the same function used to process the views.  So, as long as
you put all the variables in the namespace, your code will execute.
Something like this should work:

from gluon.template import render
context = Storage()
context.rows = rows
content = """
<HTML>
<p>
{{
for row in rows:
  ..something with rows..
for c in rows.colnames:
  ..something with colnames..
=A("some link text", =href=URL("index"))

}}

</p>
</HTML>
"""
rendered = render(content, context=context)



On Nov 2, 11:43 am, lucas <sjluk...@gmail.com> wrote:
> yes, but even more general then only fields, like you can have entire
> sections of blocked executable code in a view like
>
> <HTML>
> <p>
> {{
> for row in rows:
>   ..something with rows..
> for c in rows.colnames:
>   ..something with colnames..
> =A("some link text", =href=URL("index"))}}
>
> </p>
> </HTML>
>
> that isn't so much a field as a big block of code, in a html/text
> file.  how do we get that to execute as python?  lucas

Reply via email to