def delete_version(cls, version_id): version = Version().get(version_id, links=True) if version is None: raise NotFoundException() # remove the version from storage first version.remove() # then remove the singer and re-index any related objects VersionIndex.delete_by_id(version.id)