[web2py] Python Code in DB

2012-03-01 Thread Hassan Alnatour
Dear ALL,

am trying to have all my code in the datebase in a table called
Pages , So i  can edit my site when its online from the CMS  , not
when i use HTML code from the database i render it with
XML(db.pages.Code) but when i has any web2py or python code it dosent
work  ...

EX.


how can i make it work when i get it from the datebase ??






Best Regards,
Hassan ALnatour


Re: [web2py] Python Code in DB

2012-03-01 Thread Bruno Rocha
you can read the field and pass it as an arg to template.render.

it will act like a view file.

from gluon.template import render
row = db.mytable[id]
template = row.template
return render(template, dict(form=form, x=y))

http://zerp.ly/rochacbruno
Em 01/03/2012 08:57, "Hassan Alnatour" 
escreveu:

> Dear ALL,
>
> am trying to have all my code in the datebase in a table called
> Pages , So i  can edit my site when its online from the CMS  , not
> when i use HTML code from the database i render it with
> XML(db.pages.Code) but when i has any web2py or python code it dosent
> work  ...
>
> EX.
> 
>
> how can i make it work when i get it from the datebase ??
>
>
>
>
>
>
> Best Regards,
> Hassan ALnatour
>