yes you can do that

On Jun 25, 4:16 pm, NickFranceschina <[email protected]>
wrote:
> is it possible during runtime to create new table definitions and have
> them executed?   so instead of putting my models in db.py, I could
> pull the meta-data from a database and build the model on the fly when
> the app starts up?  (if it is on SQL, it will do the usual maintenance
> stuff... if it is on GAE it doesn't do anything)
>
> I'd like to let users create their own "types"... on GAE this is easy
> as there is no hard "schema" to follow... but I want the app to work
> both on GAE and SQL (which is why I'm using Web2py)... so wondering
> how that would work if I tried to define a table on the fly:
>
> i.e.
>
> default.py
>
>   def index():
>
>      fields = get_fields(); #returns a list of Field() objects
>      tbl = db.define_table(mytable,fields)
>
> Thank you,
> -Nick Franceschina

Reply via email to