Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
beat
beat.editor
Commits
deb1d791
Commit
deb1d791
authored
Jun 05, 2019
by
Samuel GAIST
Browse files
[backend][assetmodel] Implement storage property in AssetType
It will return the storage class matching the asset
parent
ca27ec87
Changes
1
Hide whitespace changes
Inline
Side-by-side
beat/editor/backend/assetmodel.py
View file @
deb1d791
...
...
@@ -65,6 +65,11 @@ class AssetType(Enum):
self
.
path
=
path
self
.
klass
=
klass
@
property
def
storage
(
self
):
mod
=
__import__
(
self
.
klass
.
__module__
,
fromlist
=
[
"Storage"
])
return
getattr
(
mod
,
"Storage"
)
@
staticmethod
def
from_path
(
path
):
for
asset_type
in
AssetType
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment