Sunday, February 23, 2014

Re: Django substitute old image of ImageFile

Hi,
    When i had a same problem for my imagefield when ever user deletes a image, i use to get the path of the image from the db delete the image record in db and  delete the image via os.system('rm image_path') from media path.

Thanks,
Lokesh

On Saturday, 22 February 2014 18:34:47 UTC+5:30, Fabrizio Alongi wrote:
Hi, I've searched a lot for this problem, but I never found one real solution.

I've a simple Django News model with an ImageField set correctly.
What I need is to delete the old image file when I upload a new image file with ImageField.

What is the best and clear solution?

I've others model have others ImageField... with the same problem.
One solution, maybe, is to clear Media Folder with an automated script... but... I prefer one standalone solution if is possible.


ps: sorry for my english! :)

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/3191af19-ff06-4037-96fb-75e9debf4e2d%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

No comments:

Post a Comment