Charles Duffy wrote:
>> ### EXAMPLE TWO: use the metadata on the activemapper module ###
>
> This works.
Excellent.
>> ### EXAMPLE ONE: specify engine on the class itself ###
>
> This doesn't.
>
> $ cat test2.py
> import sqlalchemy.mods.threadlocal
> from sqlalchemy import *
> from sqlalchemy.ext.activemapper import *
>
> engine = create_engine('sqlite:///:memory:')
>
> class Foo(ActiveMapper):
> class mapping:
> __table__ = 'foo_tbl'
> __engine__ = engine
> foo_id = column(Integer, primary_key=True)
> foo_text = column(String(30))
>
> Foo.table.create()
> f = Foo(foo_text='test').flush()
My fault. You need to use __metadata__, not __engine__, now that we are
in the 0.2 series. Let me know if that works for you!
--
Jonathan LaCour
http://cleverdevil.org
_______________________________________________
Sqlalchemy-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users