I see -- you want to be able to treat blog.body as a web2py template, not 
as HTML content or pure Python. Maybe try something like this:

{{from gluon.template import render}}
{{=XML(render(blog.body, context=response._vars))}}

Or maybe use context=globals() if the template needs to access other 
objects in the view environment besides the items returned by the 
controller (e.g., models or web2py API objects).

You could also do that in the controller and return the XML object from the 
controller.

Anthony

Or maybe try context=globals() if you need other items in the environment 
besides those returned by the controller.

On Thursday, June 21, 2012 5:42:52 PM UTC-4, RKS wrote:
>
> Yes. Inside the actual field I use HTML and python. If I use 
> {{=XML(blog.body)}} then I can insert all the HTML I want inside that field 
> from the db administration. Very helpful.
>
> But now I want to be able to insert {{=blog.title}} inside the blog.body 
> field and when it renders int he view I want to execute {{=blog.title}}. 
> Also, I have an HTML view that aggregates all of the blogs. So I want to 
> include this inside the field blog.body.
>
> So with your example are you saying when I use {{=XML(blog.body)}} I 
> should use {{=eval(blog.body)}} or are you telling me to put eval or exec 
> inside the {{=blog.title}} that I am calling inside the field? So would it 
> be {{=exec(blog.body)}} or {{=exec(blog.title)}} inside blog.body?
>
> Sorry, this all seems confusing. Thanks.
>

-- 



Reply via email to