bradleyg / django-s3direct

Directly upload files to S3 compatible services with Django.
MIT License
661 stars 234 forks source link

Added support for args to be passed to key when it's callable #140

Closed alej0varas closed 6 years ago

alej0varas commented 6 years ago

The user case for this change is that I want to generate the filename and also set a path like

In settings.py

def get_filename(file_name, args):
    return file_name + '/' + args

S3DIRECT_DESTINATIONS = {
    'assets:background': {
        'key': get_filename,
        'key_args', 'asset/background'
    },
bradleyg commented 6 years ago

Great, can you add it to the readme? (with the stipulation it only does something if 'key' is indeed a function).

Thanks!

alej0varas commented 6 years ago

I've updated the readme

bradleyg commented 6 years ago

Thanks!