def delete(self, using=None):
        cid = self.pk
        for image in self.basecollectionitem_set.instance_of(Image):
            image.delete()
        for nidmresult in self.basecollectionitem_set.instance_of(NIDMResults):
            nidmresult.delete()
        ret = super(Collection, self).delete(using=using)
        collDir = os.path.join(PRIVATE_MEDIA_ROOT, 'images',str(cid))
        try:
            shutil.rmtree(collDir)
        except __HOLE__:
            print 'Image directory for collection %s does not exist' %cid

        return ret
dataset/ETHPy150Open NeuroVault/NeuroVault/neurovault/apps/statmaps/models.py/Collection.delete