def _word_count(msg):
    return len(msg.split())

@event.listens_for(Comment.message, 'set')
def set(target, value, oldvalue, initiator):
    pass
Can SQLAlchemy events be used to update a denormalized data cache?