Пример #1
0
 def delete_image(self, image: Image):
     if self.data.get_instances_by_image_id(image.id):
         raise ImageWithInstancesError(image)
     if image.id is None:
         raise NonExistingImageError(image)
     self.data.remove_image(image.id)
     self.save()
     image.unbind_meta_repo()
Пример #2
0
 def delete_image(self, image: Image):
     self._delete_object(self.images, image, NonExistingImageError)
     image.unbind_meta_repo()
Пример #3
0
 def delete_image(self, image: Image):
     if image.id is None:
         raise NonExistingImageError(image)
     self.data.remove_image(image.id)
     self.save()
     image.unbind_meta_repo()