def destroy_image(self, id, chan): try: image = Image.get(id=id, chan=chan) except Image.DoesNotExist: return None image.delete_instance() return image
def store(self, image, chan, name=""): Image.create(chan=chan, name=name, image=image.image, word=image.word, tiny=image.tiny)