def before_udpate(mapper, connection, target):
    state = db.inspect(target)
changes = {}
for attr in state.attrs:
    hist = state.get_history(attr.key, True)
Отслеживание изменений модели в SQLAlchemy