Skip to content

Commit

Permalink
Add deconstructible decorator
Browse files Browse the repository at this point in the history
  • Loading branch information
Siburg committed Mar 29, 2020
1 parent c92462a commit 88440ed
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion inmemorystorage/storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from django.conf import settings
from django.core.files.storage import Storage
from django.core.files.base import File
from django.utils.deconstruct import deconstructible
try:
from django.utils.encoding import filepath_to_uri, force_bytes
except ImportError:
Expand Down Expand Up @@ -159,7 +160,7 @@ def save(self, path, content):

_filesystem = InMemoryDir()


@deconstructible
class InMemoryStorage(Storage):
"""
Django storage class for in-memory filesystem.
Expand Down Expand Up @@ -208,3 +209,6 @@ def accessed_time(self, name):
def created_time(self, name):
file = self.filesystem.resolve(name)
return file.created_at

def __eq__(self, other):
return self.filesystem == other.filesystem and self.base_url == other.base_url

0 comments on commit 88440ed

Please sign in to comment.