Can you explain the purpose? You can create a derivative class of
Table (is it just a table) but this is not the same as model
inheritance in ORMs, becuase tables (lower case) are not classes in
DAL. To do model inheritance
db.define_table('a',*fields)
db.define_table('b',db.a,*other_fields)
On 31 oct, 04:11, Stef Mientki <[email protected]> wrote:
> hello,
>
> I'ld like to derive a new class from Table
> (if it succeeds, I can integrate DAL into my existing programs, without
> changing anything, except
> adding an import statement)
>
> This seems to be the obvious way,
> the problem is that although a table seems to be created,
> the Table is not attached to the database.
> So writing to the database disappears in the universe.
>
> class DAL_Table ( Table ) :
> def __init__ ( self, DB, Name, Defs, Drop = False, Mod_Table = False ) :
> ... do my preprocessing, generate Fields
> Table.__init__ ( self, DB, Name, *Fields, migrate = Name + '.table' )
>
> This ones create a table attached to a database,
> but the DAL_Table doesn't hace the properties of Table
> class DAL_Table ( object ) :
> def __init__ ( self, DB, Name, Defs, Drop = False, Mod_Table = False ) :
> ... do my preprocessing, generate Fields
> My_Table = DB.define+table ( Name, *Fields, migrate = Name + '.table'
> )
> ... but now DAL_Table doesn't have the properties of Table
>
> thanks,
> Stef Mientki