Commit deb1d791 authored by Samuel GAIST's avatar Samuel GAIST
Browse files

[backend][assetmodel] Implement storage property in AssetType

It will return the storage class matching the asset
parent ca27ec87
...@@ -65,6 +65,11 @@ class AssetType(Enum): ...@@ -65,6 +65,11 @@ class AssetType(Enum):
self.path = path self.path = path
self.klass = klass self.klass = klass
@property
def storage(self):
mod = __import__(self.klass.__module__, fromlist=["Storage"])
return getattr(mod, "Storage")
@staticmethod @staticmethod
def from_path(path): def from_path(path):
for asset_type in AssetType: for asset_type in AssetType:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment