well. One can have two tables:

db.define_table('meta',Field('tablename'),Field('fieldname'))

def give_me_table(tablename):
     return db.define_table(tablename, *[Field(f.fieldname) for f in 
db(db.meta.tablename==tablename).select()])

db.meta.insert(tablename = 'product', fieldname='short_description')
db.meta.insert(tablename = 'product', fieldname='long_description')

product = give_me_table('product')


On Saturday, 28 January 2017 08:12:54 UTC-6, Yoel Benitez Fonseca wrote:
>
> think he wants to add fields on-the-fly to the database based on user 
> input. 
>
> 2017-01-27 23:30 GMT-05:00 Massimo Di Pierro <massimo.dipie...@gmail.com>: 
>
> > sorry do not understand 
> > 
> > 
> > On Friday, 20 January 2017 18:42:22 UTC-6, Corden Naraga wrote: 
> >> 
> >> Scenario: I have a Terms option ranging from 1-6. If I select 3, 3 
> labels 
> >> and 3 text fields will be generated to the form and can be saved to the 
> >> database. 
> >> 
> >> eg: 
> >> - Terms: 3 
> >> - Result: 
> >> Label1 TextFieldDate1 TextFieldValue1 
> >> Label2 TextFieldDate2 TextFieldValue2 
> >> Label3 TextFieldDate3 TextFieldValue3 
> >> 
> >> Just found the same scenario with jquery, but want to insert into mysl 
> or 
> >> postgresql database. 
> >> 
> >> Thanks. 
> > 
> > -- 
> > 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/d/optout. 
>
>
>
> -- 
> Yoel Benítez Fonseca 
> http://redevil.cubava.cu/ 
> $ python -c "import this" 
>

-- 
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/d/optout.

Reply via email to