Re: [sqlalchemy] Cascade child updates onto the parent

2020-05-28 Thread Colton Allen
Perfect. That's exactly what I ended up doing. I added events (after_insert/update/delete) for each backref. For each has-many relationship (through a secondary table) I had to consider the fact that the parent model would exist in session.dirty but not trigger the "onupdate" action on the

Re: [sqlalchemy] Cascade child updates onto the parent

2020-05-28 Thread Mike Bayer
On Wed, May 27, 2020, at 3:57 PM, Colton Allen wrote: > Hello, > > I'm trying to automate a backref update. Basically, when a child model is > inserted or updated I want the parent model's "updated_at" column to mutate. > The value should be the approximate time the user-child-model was

[sqlalchemy] Cascade child updates onto the parent

2020-05-27 Thread Colton Allen
Hello, I'm trying to automate a backref update. Basically, when a child model is inserted or updated I want the parent model's "updated_at" column to mutate. The value should be the approximate time the user-child-model was updated. The updated_at value would not have to match the