Hi all,

I'm retrofitting the SA versioning example [http://www.sqlalchemy.org/
docs/orm/examples.html#versioned-objects] into a large TG2 webapp.

Since I would like to make versioning transparent to the existing
controller's code, I would like a new version to be emitted when I
update a relationship. So with something like :
Activity:
 customer_ref = Column(UUID, ForeignKey('customers.uuid'))
 customer=relationship(Customer, primaryjoin=\
 
Activity.__table__.c.customer_ref==Customer.__table__.c.uuid,
                                       backref="activities")

versioning works correctly if I update the customer_ref attribute, but
not the customer relationship. What I think is happening, is that
since the VersionedListener operates on the before_flush hook, it
seems that updating the customer rel will propagate the change to the
customer_ref only during the flush, thus not creating a new version.

Is there a way around it by modifying the history mapper or do I have
to manually add listener extensions to each relationaship ? Any other
solutions by anyone confronted with this problem ?

Many thanks and happy Xmas,
A.

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to [email protected].
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.

Reply via email to