[web2py] Is it possible to execute {{code}} from database?

2014-02-22 Thread Robin Manoli
Suppose db.page.content has some text like : {{ arbitrary python code }}. 
Would this python code then be executed? Is it possible to execute such 
code?

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [web2py] Is it possible to execute {{code}} from database?

2014-02-22 Thread Jonathan Lundell
On 22 Feb 2014, at 3:31 PM, Robin Manoli ramat...@gmail.com wrote:
 Suppose db.page.content has some text like : {{ arbitrary python code }}. 
 Would this python code then be executed? Is it possible to execute such code?
 
 

Assuming that the code is a valid web2py template, I think you could set 
response.view to StringIO(your_text) and it'd be rendered normally as a web2py 
view (template). If that's what you're after...

That's just my quick reading of the template code, not solid information.

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.