I have 2 models:
Model1(models.Model):
and
Model2(models.Model):
fk = models.ForeignKey("Model1", on_delete=models.CASCADE)
image = models. ImageField(…..)
I use Reversion app to restore all deleted data and both models are registered in admin with Version admin. It works but when I restore any entry of model1 it would not restore actual files from Imagefield of the Model2. Thats reasonable because they are deleted by CASCADE. If I set on_delete = DO_NOTHING, it would rise integrity error as Postgree supports cross table integrity protection. Thats reasonable as well. If I use SET_NULL , then Reversion would not be able correctly restore images as it would loose foreignkey ID obviously. Question is how to restore associated images of the Model2 within data of the Model1 by Reversion or alternatively keep foreignkey ID of the Model2’s images intact if I use something outside CASCADE in order to not delete the images from the file system?
Thank you!