[sqlalchemy] after_commit and failure

2017-09-18 Thread cecemel
Hi, will the after_commit event get fired if the commit failed? Don't see anything in the doc about that. thx -- SQLAlchemy - The Python SQL Toolkit and Object Relational Mapper http://www.sqlalchemy.org/ To post example code, please provide an MCVE: Minimal, Complete, and Verifiable Exa

Re: [sqlalchemy] Re: getting model's grandparent after persistent_to_deleted event has fired.

2017-08-22 Thread cecemel
in 'bed' -model (e.g house_id), once 'room'-backref has been loaded ? On Tuesday, August 22, 2017 at 5:36:39 PM UTC+2, Mike Bayer wrote: > > you would need to illustrate an MCVE of what's happening. objects > don't "lose track" of their rel

[sqlalchemy] Re: getting model's grandparent after persistent_to_deleted event has fired.

2017-08-22 Thread cecemel
@update: calling the flush doen't seem to make any difference. At some point, the object looses track of it's grandparents On Tuesday, August 22, 2017 at 3:57:23 PM UTC+2, cecemel wrote: > > Hi, > > so, I'm currently facing this issue, where I would like to do s

Re: [sqlalchemy] getting model's grandparent after persistent_to_deleted event has fired.

2017-08-22 Thread cecemel
#x27;. (So no linked Ids to Room and House, since the row does not exist anymore) Could you elaborate a bit, or point to some documentation? thanks! On Tuesday, August 22, 2017 at 4:33:08 PM UTC+2, Mike Bayer wrote: > > On Tue, Aug 22, 2017 at 9:57 AM, cecemel > wrote: > > Hi,

[sqlalchemy] getting model's grandparent after persistent_to_deleted event has fired.

2017-08-22 Thread cecemel
Hi, so, I'm currently facing this issue, where I would like to do some calls to an external service, when my object has been deleted within a flush. For this operation to occur, I need the id from my model object, but also the id from the parent of the parent object model. There are cases, whe

[sqlalchemy] Re: SQLAlchemy: backref and object loaded from DB not working?

2017-08-22 Thread cecemel
yep indeed, it works, I was doing something wrong. Thanks for all the help and sorry about late reply On Thursday, August 17, 2017 at 9:57:39 PM UTC+2, cecemel wrote: > > Is the backref relationship supposed to work with objects loaded from the > DB? > > > Here is the case:

[sqlalchemy] SQLAlchemy: backref and object loaded from DB not working?

2017-08-17 Thread cecemel
Is the backref relationship supposed to work with objects loaded from the DB? Here is the case: Similar to the (doc/tutorial ) I have the following classes: from sqlalchemy import Integer, ForeignKey, String, Column