Re: ImageField anti-duplication

2009-09-20 Thread A. Rossi
Yup, that did it! Thanks for pointing that out! That article was hard to find in the documentation. On Sep 12, 7:58 pm, "A. Rossi" wrote: > I had not considered writing a custom Storage class. I may try that if > there are no other alternatives. > > Any other ideas/solutions? > > On Sep 12, 5:

Re: ImageField anti-duplication

2009-09-12 Thread A. Rossi
I had not considered writing a custom Storage class. I may try that if there are no other alternatives. Any other ideas/solutions? On Sep 12, 5:31 am, vinilios wrote: > Have you read this ? > > http://docs.djangoproject.com/en/dev/howto/custom-file-storage/ > > haven't used any custom file stor

Re: ImageField anti-duplication

2009-09-12 Thread vinilios
Have you read this ? http://docs.djangoproject.com/en/dev/howto/custom-file-storage/ haven't used any custom file storage yet but maybe using a custom file- storage with a dummy save method when file exists is what you need. On Sep 12, 1:43 pm, "A. Rossi" wrote: > I have an application where

ImageField anti-duplication

2009-09-12 Thread A. Rossi
I have an application where users can upload images, then the image is renamed to a SHA256 hash of the file's contents. Here is the relevant snippet of the model class ImagePost(Post): def imgurl(self, filename): import hashlib, os.path extension = os.path.splitext(filename)