The load and refresh events is close to what I am looking for.
I need to be able to modify attribute of object/instance that have
been
load or refreshed. I can not do the work in load or refresh event
because
any changes made in the events are not track and written out on a
flush/commit.
.
I am using the load event and refresh event to build build a list of
object/instance that
have been loaded or refreshed and my query class does the callback
to instance that
have been loaded or refresh. This work for query that I do but does
not handle the case
where lazy loading or deferred/refresh attribute.
What I looking for is way to get callback for any data that loaded
or refreshed once it is safe to modify
attribute. I can the use the list of instance that need to be worked
based on load and refresh events.
I only need this for ORM. I am filter stuff in event
instance_new = []
def _load_event(self, target, context):
global instance_new
if '_sa_orm_load_options' in context.execution_options:
instance_new.append(target)
On 4/27/21 4:51 PM, Mike Bayer wrote:'