The following works great when going to the objects adminpage and select delete. The problem is that when using multiselect and deleting multiple items at once it doesn't use my delete-override. I've been looking for a solution but haven't found one so it's time to turn to the masters ;)
class Photo(models.Model):
name = models.CharField(max_length=256, unique=True)
slug = models.SlugField(unique=True)
image = models.ImageField(upload_to='photos/')
def delete(self):
super(Photo, self).delete()
### Check if the dir is empty, then remove the folder
ph = Photo.objects.filter(album=self.album)
if ph.count() == 0:
rmtree(os.path.join(settings.MEDIA_ROOT, 'photos/' + self.album.slug))