Closed atodorov closed 6 years ago
@bartTC can you check this out? I will write the missing tests but I need some opinion on the general approach in this PR
@atodorov I think this is fine. I was trying to figure out if this is something we actually have to do, or if the FileField can handle this automatically once it'smodel gets deleted.
I was trying to figure out if this is something we actually have to do, or if the FileField can handle this automatically once it'smodel gets deleted.
Note that when a model is deleted, related files are not deleted. If you need to cleanup orphaned files, you’ll need to handle it yourself
It looks like deleting files automatically has been removed in Django 1.3: https://docs.djangoproject.com/en/2.0/releases/1.3/#deleting-a-model-doesn-t-delete-associated-files
I will go ahead and write the missing tests.
Interesting. Thank you, this is a nice addition!
@bartTC please review.