def new_version(self, session):
    old_id = self.id
    session.query(self.__class__).filter_by(id=old_id).update(values=dict(is_current_version=False), synchronize_session=False)
    make_transient(self)
    self.version_id += 1
def new_version(self, session):
    old_id = self.id
    session.query(self.__class__).filter_by(id=old_id).update(values=dict(is_current_version=False), synchronize_session=False)
    make_transient(self)
    self.version_id += 1