Re: Generate a random directory for files to be uploaded

2013-12-05 Thread Matt Lind
Disregard. I found my error. I was trying to pass something I shouldn't have. This seems to be working now. Thanks again! On Thursday, December 5, 2013 9:10:13 AM UTC-5, Daniel Roseman wrote: > > On Thursday, 5 December 2013 12:23:52 UTC, Matt Lind wrote: >> >> Ok, I get what what you're sayi

Re: Generate a random directory for files to be uploaded

2013-12-05 Thread Matt Lind
I did miss that thanks! However, I now seem to have an issue with the def my_upload_to(instance, filename) line. Apparently "self" nor "instance" works here, and so I am getting the error 1 argument given when I need "two". @staticmethod doesn't seem to want to work properly either. Thanks ag

Re: Generate a random directory for files to be uploaded

2013-12-05 Thread Matt Lind
I should also state that further down in the code I make use of snippets like: basename = os.path.basename( instance.file.file.name ) So by not passing and uploading the file right away it seems like those snippets don't work anymore On Sunday, November 24, 2013 10:31:34 AM UTC-5, Michael Manf

Re: Generate a random directory for files to be uploaded

2013-12-05 Thread Daniel Roseman
On Thursday, 5 December 2013 12:23:52 UTC, Matt Lind wrote: > > Ok, I get what what you're saying, but I seem to be having a heck of a > time getting the randDir passed into the instance to perform the upload. > > Here is the new code snippets: > > views.py > instance = Upfile( file = file) > inst

Re: Generate a random directory for files to be uploaded

2013-12-05 Thread Matt Lind
Ok, I get what what you're saying, but I seem to be having a heck of a time getting the randDir passed into the instance to perform the upload. Here is the new code snippets: views.py instance = Upfile( file = file) instance.upload(randDir) models.py @staticmethod def upload(randDir) file =

Re: Generate a random directory for files to be uploaded

2013-11-24 Thread Michael Manfre
There are two things that you'll need to do. Set the random directory name on the UpFile instance in the view and define a function to use with upload_to that uses the random directory name on the instance to define the file's target path. https://docs.djangoproject.com/en/dev/ref/models/fields

Generate a random directory for files to be uploaded

2013-11-23 Thread Matt Lind
So I am trying to modify django-jfu ( a multi uploader) to send files to a unique directory for every unique upload session performed. This is just due to my application's requirements and to prevent file collisions during the operations later down the road in my app. Anyway, here is views.py