Add to GoogleCloudStorage
This decorator is required to allow Django 1.7 migrations to serialize
instances of this class.  Without the decorator, running "makemigrations"
on code like the following will fail with a "Cannot Serialize" error.
from storages.backends.gcloud import GoogleCloudStorage
gcs = GoogleCloudStorage()
class SomeModel(models.Models):
some_field = models.FileField(storage=gcs)
@@ -3,6 +3,7 @@ from tempfile import SpooledTemporaryFile
from django.core.exceptions import ImproperlyConfigured
from django.core.files.base import File
+from django.utils.deconstruct import deconstructible
from django.utils.encoding import force_bytes, force_text, smart_str
from storages.compat import Storage
from storages.utils import setting
@@ -71,6 +72,7 @@ class GoogleCloudFile(File):
self._file = None
+@deconstructible
class GoogleCloudStorage(Storage):
client_class = Client
bucket_class = Bucket
