Re: Django substitute old image of ImageFile

2014-02-24 Thread Mike Dewhirst
Fabrizio Very nice - I'll borrow that for sure :) Thanks Mike On 24/02/2014 11:38pm, Fabrizio Alongi wrote: Hi, after I've searched online, and from this reply I have wrote this

Re: Django substitute old image of ImageFile

2014-02-24 Thread Fabrizio Alongi
Hi, after I've searched online, and from this reply I have wrote this solution by overriding save method of my model class. def save(self, force_insert=False, force_update=False,

Re: Django substitute old image of ImageFile

2014-02-23 Thread lokesh
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

Re: Django substitute old image of ImageFile

2014-02-22 Thread Mike Dewhirst
On 23/02/2014 9:51am, Fabrizio Alongi wrote: Any solutions?? :/ I'm interested too. I have it on my todo list to write a delete routine for my own software to get rid of uploaded files which are being replaced. I haven't decided whether to make it automatic or not. I haven't gotten around to

Django substitute old image of ImageFile

2014-02-22 Thread Fabrizio Alongi
Any solutions?? :/ -- 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+unsubscr...@googlegroups.com. To post to this group, send email to

Django substitute old image of ImageFile

2014-02-22 Thread Fabrizio Alongi
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