-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How can I delete an image each time I delete the instance asociated with it? #16
Comments
This is just how Django works for media files, it works the same for all storages, this is by design. If you dont like it, you can use Django signals or you can delete given file in overwritten delete model method, pls see Django docs for more info |
I understand. Is there a way to at least get the |
Field file actually has You should never do sth like |
That is what I was looking for!
and it works great. Thanks a lot |
If I have a model that has an ImageField as an attribute, how can I delete the image each time I do model_instance.delete()? I've seen that there is the
deleteorphanedmedia
command, but I don't understand how to use it each time I delete something that has an image.What extra steps do I need to add to achieve this so I stop having orphan images?
The text was updated successfully, but these errors were encountered: