On Tuesday, May 10, 2011 10:32:34 PM UTC-4, Anthony wrote:
>
> To keep things DRY, you can define a template table in a model file and use
> table inheritance to define the specific tables where needed (see
> http://web2py.com/book/default/chapter/06#Table-Inheritance). For example,
> in a model file:
>
> db.define_table('template',
> Field('name'),
> Field('owner'),
> Field('plan'),
> Field('actual'),
> Field('status'))
>
Actually, you should probably use the dummy table method discussed in the
book:
template = db.Table(db, 'template',
Field('name'),
Field('owner'),
Field('plan'),
Field('actual'),
Field('status'))
And in the controller:
db.define_table(company_accounts_db, template)
Anthony