This code is inside a class. I need to access variables defined in the classe's self. How could I pass self to the entry_deletion_images_delete ?
@receiver(pre_delete, sender=Document, dispatch_uid='document_delete_signal')
def entry_deletion_images_delete(sender, instance, using, **kwargs):
for key, value in self.SIZES.items():
os.remove(self.base_dir + instance.image_main.name)
Since this function uses built in arguments, simply putting self as a new argument is not possible.