[Zope-dev] zope.sqlalchemy

Laurence Rowe l at lrowe.co.uk
Mon May 5 21:26:58 EDT 2008


Following discussions with Kapil, Christian and Martin I've developed 
zope.sqlalchemy. The aim is to provide a common base for transaction 
integration. It does not attempt to define any particular way to handle 
database configuration as there is not yet consensus on the best way to 
handle it.

I've uploaded it to zope svn and pypi. See 
http://pypi.python.org/pypi/zope.sqlalchemy

Currently it depends on a development version of SQLAlchemy. I hope to 
make a release following the 0.4.6 release of SQLAlchemy.

See pypi or the readme for details, but briefly usage is something like:

     >>> engine = create_engine('sqlite:///')
     >>> Session = scoped_session(sessionmaker(
     ... bind=engine, transactional=True, autoflush=True,
     ... extension=ZopeTransactionExtension()))
     >>> session = Session()
     >>> session.save(User(name='bob'))
     >>> transaction.commit()

Any comments appreciated.

Laurence



More information about the Zope-Dev mailing list