SQLAlchemy 监听事件 发表于 2018-02-01 | 分类于 Database | 浏览量: 1234@event.listens_for(db.Model, 'before_update', propagate=True)def update_lasttime(mapper, connection, target): if hasattr(target, 'lasttime'): target.lasttime = datetime.now()