Re: Store ImageField file using id as filename

2009-08-30 Thread Gonçalo Ferreira
Hi Mike, Thanks a lot for the input! I'll study all the alternatives you mentioned to see which suits my project better. Again, thanks! Gonçalo On Sun, Aug 30, 2009 at 2:45 AM, Mike Ramirez wrote: > On Saturday 29 August 2009 04:03:58 pm gon...@gmail.com wrote: > > I'm trying to store images

Re: Store ImageField file using id as filename

2009-08-29 Thread Mike Ramirez
On Saturday 29 August 2009 04:03:58 pm gon...@gmail.com wrote: > I'm trying to store images using the admin interface with the id as > the filename. > > class ProductImage(models.Model): > image = ImageField(upload_to=get_path) > > def get_path(self, filename): > return 'product_ima

Store ImageField file using id as filename

2009-08-29 Thread gon...@gmail.com
I'm trying to store images using the admin interface with the id as the filename. class ProductImage(models.Model): image = ImageField(upload_to=get_path) def get_path(self, filename): return 'product_images/%s.jpg' % self.id However, the images get stored as 'product_images/Non