I'm not sure if you can do this with DAL.
However, maybe if you use an ORM you can derivate models.
Time ago someone write about using Django ORM or SQLAlchemy in web2py for
make this, you can read here [1] and here [2].

Correct me if i am not on the right way, thanks.

[1] http://www.mail-archive.com/web2py@googlegroups.com/msg36450.html
[2] http://web2py.com/AlterEgo/default/show/189


On Sun, Oct 31, 2010 at 10:11 AM, Stef Mientki <stef.mien...@gmail.com>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
>
>

Reply via email to