you can get access/control of 'initiator' using the AttributeImpl directly. Look inside of sqlalchemy/orm/attributes.py backref_listeners() to see examples. You want to establish the listener using "raw=True" so you get passed the InstanceState object directly.
On Jul 10, 2013, at 1:27 PM, Greg Yang <sorcerero...@gmail.com> wrote: > I'm writing an application that uses kivy for GUI and sqlalchemy for ORM. > Each has its own instrumentation system, and I initially planned to connect > them by 1) mirroring relevant SA attributes in kivy at init, 2) work with > only the kivy versions of the attributes for the duration of the app, 3) on > write events in kivy, propagate the writes to SA. This works well except when > inside SA, changes are propagated through relationships and backrefs. Then I > need to reload kivy attributes from their SA mirror parts when such things > happen. But I'm having a hard time trying to figure out a way to do this > without getting an infinite feedback loop. Particularly, I looked at the > AttributeEvents of SA, and the initiator argument seems hopeful, but I'm not > familiar with the internals of SA. Does the attribute implementation object > have attributes/methods that allows me to prevent the loop? Otherwise, is > there an easy way to handle this? Or do I need to get dirty and do something > like constructing a child class of both kivy and SA properties? > > -- > 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 sqlalchemy+unsubscr...@googlegroups.com. > To post to this group, send email to sqlalchemy@googlegroups.com. > Visit this group at http://groups.google.com/group/sqlalchemy. > For more options, visit https://groups.google.com/groups/opt_out. > > -- 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 sqlalchemy+unsubscr...@googlegroups.com. To post to this group, send email to sqlalchemy@googlegroups.com. Visit this group at http://groups.google.com/group/sqlalchemy. For more options, visit https://groups.google.com/groups/opt_out.