On Sep 18, 2:54 pm, Michael Bayer <[EMAIL PROTECTED]> wrote: > 2. more involved: catch change events and populate a Child.grandparent > relation(). 0.5 has made the AttributeExtension API public which > would be a good place to catch this event. The advantage to this is > that your Child has a "grandparent" already set before any SQL is > issued to the database.
Thanks Michael, I managed to get 2. to work.. However I was now thinking it may be simpler to create a new relation 'grandchildren' on the grandparent.. and add the new child to both the parent and grandparent parent.children = [child] grandparent.grandchildren = [child] Is there a hook for me to add to the second collection automatically (i.e. an event when object is added to a collection)? Thanks --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---