Re: [sqlalchemy] Using a backref-generated attribute in an event listener

2015-06-29 Thread Mike Bayer
On 6/29/15 5:37 AM, Adrian wrote: I tried this code: @listens_for(AttachmentFolder.all_attachments, 'append') def _attachment_added(target, value, *unused): target.modified_dt = now_utc() However AttachmentFolder.all_attachments is a backref so it doesn't exist at import time (I usually

[sqlalchemy] Using a backref-generated attribute in an event listener

2015-06-29 Thread Adrian
I tried this code: @listens_for(AttachmentFolder.all_attachments, 'append') def _attachment_added(target, value, *unused): target.modified_dt = now_utc() However AttachmentFolder.all_attachments is a backref so it doesn't exist at import time (I usually register listeners right after the def