AttributeError:“收件人”对象没有属性“更新”

我是python和sqlalchemy的新手。我有以下代码。我想使用sql alchemy更新数据库,如果在ID中找不到ID,则抛出错误

def update_recipient(self, recipient_id: int, update_details: Dict):

    with utils.session_scope() as session:

        # checks if the ID is in the db and throws and error if not
        try:
            recipient = session.query(Recipient).filter(Recipient.id == recipient_id).one()
            recipient.update(update_details, synchronize_session="fetch", )
        except exc.NoResultFound:
            message = "Recipient with id : {} not found".format(recipient_id)
            self.logger.exception(message)
            raise errors.ItemNotFoundException(message=message)