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 definition of the model class). So I 
tried using the mapper_configured
event, but backrefs still don't exist at that point.

Besides flipping the relationship/backref around (which would work only 
because I don't have
any listeners on the relationship itself yet), is there any clean way to 
bind an event listener
to a backref?

-- 
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/d/optout.

Reply via email to