0
问候 有在我的富模型的ImageField的对象,例如:Django的:ImageField的禁用图像删除
class Foo(models.Model):
name = models.CharField(max_length=50)
photo = models.ImageField(upload_to='foobar', blank=True, null=True)
我想富禁用删除上传的照片一旦Foo对象被删除,具体的。我怎样才能做到这一点?
即:
If self.name == "foo":
#skip deleting the image from the harddisk.