2010-07-01 45 views
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. 

回答

相關問題