Sqlalchemy: automatically calculate the value of a column upon another column changed <p>I want the value of a column (<code>is_dangerous_token</code>) to be calculated using a method. Here is what I have gone so far.</p> <pre><code>class PassRecovery(DeclarativeBase): __tablename__ = 'pass_recoveries' id = Column(Integer, primary_key=True) account_email_address = Column(Unicode(255), ForeignKey('accounts.email_address'), index=True) account = relationship('Account', backref=backref('pass_recoveries', cascade='all, delete-orphan')) _is_dangerous_token = Column('is_dangerous_token', Unicode(255)) def _set_is_dangerous_token(self, account_email_address): secret_key = config.get('is_dangerous_key') signer = TimestampSigner(secret_key) self._is_dangerous_token = signer.sign(account_email_address) def _get_is_dangerous_token(self): return self._is_dangerous_token is_dangerous_token = synonym( '_is_dangerous_token', descriptor=property(_get_is_dangerous_token, _set_is_dangerous_token) ) </code></pre> <p>But the problem is that when I create a row by passing in the email_address, the <code>is_dangerous_token</code> is not generated using the code I wrote. The created row only has the <code>id</code> and the relation to the <code>account</code> and <code>is_dangerous_token</code> has no value in the database. thanks for any help</p>