Hello,
I am using sqlalchemy with pylons. I write audit log messages to table.
I use the orm to map my table to my class.
orm.mapper(AuditTable, audit_table)
self.engine = create_engine(connect_string)
metadata.bind = self.engine
metadata.create_all()
OK,
after some more reading and thinking, I think i managed it this way:
self.session.add(at)
self.session.flush()
# At this point at contains the primary key id
at.signature = self._sign( at )
self.session.merge(at)
self.session.commit()
Kind
2011/5/30 Cornelius Kölbel cornelius.koel...@lsexperts.de
OK,
after some more reading and thinking, I think i managed it this way:
self.session.add(at)
self.session.flush()
# At this point at contains the primary key id
at.signature = self._sign( at )