Re: [web2py] Re: Copy tables from existing table

2010-02-01 Thread Thadeus Burgess
So if I wanted to copy tables over, but set unique=False I ended up with the following audit_table = [copy.copy(f) for f in table] for i in range(len(audit_table)): audit_table[i].unique = False db.define_table(table.table_name + '_auditlog', Audit.audit_template, *audit_

Re: [web2py] Re: Copy tables from existing table

2010-01-28 Thread Thadeus Burgess
Sometimes I think to myself and say, "Why didn't I just try that!" Thank you, both of you! -Thadeus On Thu, Jan 28, 2010 at 4:27 PM, mdipierro wrote: > Or > > db.define_table('newname',db.othertable) > > On Jan 28, 4:19 pm, DenesL wrote: >> db.define_table('newname',*[f for f in db.table])

[web2py] Re: Copy tables from existing table

2010-01-28 Thread mdipierro
Or db.define_table('newname',db.othertable) On Jan 28, 4:19 pm, DenesL wrote: > db.define_table('newname',*[f for f in db.table]) > > On Jan 28, 2:20 pm, Thadeus Burgess wrote: > > > Is there a way to iterate through the Field() elements of a table and > > use them to create another similar tab

[web2py] Re: Copy tables from existing table

2010-01-28 Thread DenesL
db.define_table('newname',*[f for f in db.table]) On Jan 28, 2:20 pm, Thadeus Burgess wrote: > Is there a way to iterate through the Field() elements of a table and > use them to create another similar table ? > > I'm looking for something like > > db.define_table('hi', Field('hello'), Field('w