Skip to content

Commit

Permalink
Merge pull request #5 from jschneier/django_17_migrations
Browse files Browse the repository at this point in the history
add deconstructible decorator to S3BotoStorage
  • Loading branch information
jschneier committed Dec 10, 2014
2 parents d0a4977 + 99b9d67 commit b02631f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
3 changes: 2 additions & 1 deletion storages/backends/s3boto.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"See https://github.com/boto/boto")

from storages.utils import setting
from storages.compat import urlparse, BytesIO
from storages.compat import urlparse, BytesIO, deconstructible

boto_version_info = tuple([int(i) for i in boto_version.split('-')[0].split('.')])

Expand Down Expand Up @@ -73,6 +73,7 @@ def safe_join(base, *paths):
return final_path.lstrip('/')


@deconstructible
class S3BotoStorageFile(File):
"""
The default file object used by the S3BotoStorage backend.
Expand Down
5 changes: 5 additions & 0 deletions storages/compat.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
from django.utils.six.moves.urllib import parse as urlparse
from django.utils.six import BytesIO

try:
from django.utils.deconstruct import deconstructible
except ImportError: # Django 1.7+ migrations
deconstructible = lambda klass, *args, **kwargs : klass

0 comments on commit b02631f

Please sign in to comment.