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
Merged

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

merged 1 commit into from
Jan 26, 2015

Conversation

ramprabhuj
Copy link
Contributor

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
Copy link
Owner

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
Copy link
Contributor Author

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
Copy link
Owner

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
Made S3BotoStorage deconstructible so that Django can migrate it.
@jschneier jschneier merged commit be70fd1 into jschneier:master Jan 26, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants