heres a version of the persistent_id function that also saves the Bar instance automatically, using the same transaction as the current flush context:
def persistent_id(self, obj): if getattr(obj, "id", None) is None: sess = MyPickler.sessions.current newsess = create_session(bind_to=sess.connection(class_mapper(Bar))) newsess.save(obj) newsess.flush() key = "%s:%s" % (type(obj).__name__, obj.id) return key --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to sqlalchemy@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en -~----------~----~----~----~------~----~------~--~---