Re: Django ignores generated name by custom storage when a callable upload_to is defined

2010-02-12 Thread Gleber
Thanks for the reply, In my opinion, upload_to like the name suggests should point to the directory to upload the file, i didn't unterstand why the mix of directory with the filename in the callable.. I think they are two separate things.. upload_to should handle the directory, and the storage

Re: Django ignores generated name by custom storage when a callable upload_to is defined

2010-02-12 Thread Karen Tracey
On Sat, Feb 13, 2010 at 12:09 AM, Gleber wrote: > I don't know if this is a bug.. Here is the minimal test case: > > class CustomStorage(FileSystemStorage): > def get_valid_name(self, name): > import random > return '%s.abc' % (random.randint(100, 999),) > > def

Django ignores generated name by custom storage when a callable upload_to is defined

2010-02-12 Thread Gleber
I don't know if this is a bug.. Here is the minimal test case: class CustomStorage(FileSystemStorage): def get_valid_name(self, name): import random return '%s.abc' % (random.randint(100, 999),) def test_uploadto(self,filename): return 'aaa/%s' % filename testA =