大家好,我有一个模型表:
class User(Base):
username: Mapped[str] = mapped_column(String(1_000), unique=True)
email: Mapped[str] = mapped_column(unique=True, nullable=True)
password: Mapped[str]
is_active: Mapped[bool] = mapped_column(default=True)
is_verified: Mapped[bool] = mapped_column(default=False)
我需要确保当电子邮件字段更改时,is_verified 字段自动更改为 False