So, here is my situation. I have a model that I save and it contains the following file:
file = models.FileField(storage=s3store, upload_to=custom_upload_to)
S3Store is a special storage solution that I implemented. Within this custom storage solution, I have a dictionary for all of my various Amazon S3 codes [dictionary with all S3BotoStorage connections]. Depending on who uploads the file, I need to send him the appropriate S3BotoStorage, which is installed in the appropriate bucket. I was wondering if it is possible to pass a parameter to my s3store.save () method from my model save method?
I was thinking about just adding the name bucket_name to the file name, but will it take too much time to add and remove it? (and memory).
Hope this makes sense!
source
share