[web2py] Re: Dynamic generation model

2011-03-16 Thread toan75
Please help me in this case, thank very much. On Tuesday, March 15, 2011 6:11:25 PM UTC+7, toan75 wrote: > > Hi Massimo Di Pierro, > > How do get "requires", "defaut", "represent",... from field: > db.mytable.myfield for create string: > "Field('myfield', requires=..., default=..., represent=...

Re: [web2py] Re: Dynamic generation model

2011-03-15 Thread Manuele Pesenti
Dear Jose, I think you posted a very interesting example... how have you resolved the problem of the spatial support by web2py? I mean the fields of the tables you are going to create dynamically are the ones of a tipically spatial extension of a db... are they supported by web2py DAL? Can you

[web2py] Re: Dynamic generation model

2011-03-15 Thread toan75
Hi Massimo Di Pierro, How do get "requires", "defaut", "represent",... from field: db.mytable.myfield for create string: "Field('myfield', requires=..., default=..., represent=...)" ? Thanks.

[web2py] Re: Dynamic generation model

2011-03-14 Thread Jose
On 14 mar, 16:23, Massimo Di Pierro wrote: > something like > > db.define_table('name',*{Field(name) for name in ]) > > On Mar 14, 11:24 am, Jose wrote: > > > Thanks Massimo. Exactly, that's what I need. Thank you

[web2py] Re: Dynamic generation model

2011-03-14 Thread Massimo Di Pierro
something like db.define_table('name',*{Field(name) for name in ]) On Mar 14, 11:24 am, Jose wrote: > Thanks Massimo. > > In my case the table "meta" corresponds to "locations. " > > What I posted works fine, but the question I have is how to create > fields using a loop. Perhaps a method ad

[web2py] Re: Dynamic generation model

2011-03-14 Thread Jose
Thanks Massimo. In my case the table "meta" corresponds to "locations. " What I posted works fine, but the question I have is how to create fields using a loop. Perhaps a method add_field. Best regards Jose

[web2py] Re: Dynamic generation model

2011-03-11 Thread Massimo Di Pierro
db.define_table('meta',Field('name')) for row in db(db.meta).select(): db.define_table(row.name,Field('fieldname')) def dynamically_add_new_table(db,name): db.meta.insert(name=name) db.define_table(name,Field('fieldname')) then you call the function dynamically_add_new_table for the