Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Made S3BotoStorage deconstructible so that Django can migrate it. #19

Merged
merged 1 commit into from Jan 26, 2015

Conversation

Projects
None yet
2 participants
@ramprabhuj
Copy link
Contributor

commented Jan 26, 2015

Without this, Django 1.7 migrations fail with
ValueError: Cannot serialize: <storages.backends.s3boto.S3BotoStorage object at 0x1050a1358> There are some values Django cannot serialize into migration files.

@jschneier

This comment has been minimized.

Copy link
Owner

commented Jan 26, 2015

Hi and thanks for the pull request. Could you explain the use case for this a bit? As you can see S3BotoStorageFile is already deconstructible and the way of using it that I am familiar with in models is to use that as your field. How do you use the S3BotoStorage object in your models file?

@ramprabhuj

This comment has been minimized.

Copy link
Contributor Author

commented Jan 26, 2015

You can specify
s3 = S3BotoStorage(params,...) image = models.ImageField(storage=s3,...)
Basically the Django FileField has a storage parameter and the user can pass any object that extends Storage

Without this PR the above code will fail in migration.

@jschneier

This comment has been minimized.

Copy link
Owner

commented Jan 26, 2015

Ah interesting, wasn't familiar with that use case, thanks for the explanation.

jschneier added a commit that referenced this pull request Jan 26, 2015

Merge pull request #19 from ramprabhuj/master
Made S3BotoStorage deconstructible so that Django can migrate it.

@jschneier jschneier merged commit be70fd1 into jschneier:master Jan 26, 2015

1 check passed

continuous-integration/travis-ci The Travis CI build passed
Details

@pyup-bot pyup-bot referenced this pull request Jul 27, 2016

Merged

Initial Update #344

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.