Sounds like session._flushing is exactly what I want… presuming it means “I have started flushing, in fact may have flushed any number of times”.
Thanks for the again-quick response, if my presumption is correct, I am all set. Regards, Val > On Jan 11, 2023, at 6:22 PM, Mike Bayer <[email protected]> > wrote: > > > a session can flush any number of times, so what here determines "after" > flush state as far as do_orm_execute()? do_orm_execute is not called within > the flush itself (well, maybe it is...) > > If you see do_orm_executes inside of the flush, I guess you could look at > session._flushing, is that what you are looking for ? > > On Wed, Jan 11, 2023, at 7:44 PM, Val Huber wrote: >> In API Logic Server, clients can make RESTful requests that cause SQLAlchemy >> reads. These are subjected to authorization security using do_orm_execute >> (which is amazing, by the way). These add filters to ensure proper access. >> This is all fine. >> >> But, when the client makes changes, these activate business logic, which >> needs to run without auth security. >> >> My question is: how can my do_orm_execute event handler determine we are >> in/after after-flush state? Sorry if I missed them, but I did not find >> variables method on session or transaction for this. >> >> Thanks in advance, >> Val >> >> >> -- >> 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 Example. See http://stackoverflow.com/help/mcve for a full >> description. >> --- >> You received this message because you are subscribed to the Google Groups >> "sqlalchemy" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected] >> <mailto:[email protected]>. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/sqlalchemy/59922a81-8e2c-4575-87c8-e178a99c7a96n%40googlegroups.com >> >> <https://groups.google.com/d/msgid/sqlalchemy/59922a81-8e2c-4575-87c8-e178a99c7a96n%40googlegroups.com?utm_medium=email&utm_source=footer>. > > > -- > 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 Example. See http://stackoverflow.com/help/mcve for a full > description. > --- > You received this message because you are subscribed to a topic in the Google > Groups "sqlalchemy" group. > To unsubscribe from this topic, visit > https://groups.google.com/d/topic/sqlalchemy/kO4zI2r6k0c/unsubscribe. > To unsubscribe from this group and all its topics, send an email to > [email protected] > <mailto:[email protected]>. > To view this discussion on the web visit > https://groups.google.com/d/msgid/sqlalchemy/d864d888-a058-403b-b25b-315cb16d3158%40app.fastmail.com > > <https://groups.google.com/d/msgid/sqlalchemy/d864d888-a058-403b-b25b-315cb16d3158%40app.fastmail.com?utm_medium=email&utm_source=footer>. -- 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 Example. See http://stackoverflow.com/help/mcve for a full description. --- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/sqlalchemy/24E9CFA0-2309-4BB6-AA42-B1DBC5833FCF%40gmail.com.
