Greetings Having an ImageField object in my Foo model as such:
class Foo(models.Model):
name = models.CharField(max_length=50)
photo = models.ImageField(upload_to='foobar', blank=True, null=True)
I want Foo to disable to delete the uploaded photo once a Foo object is deleted and a specific . How can I do this?
Ie:
If self.name == "foo":
#skip deleting the image from the harddisk.