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
061ce41e
Commit
061ce41e
authored
May 08, 2019
by
Samuel GAIST
Browse files
[backend][assetmodel] Add method to AssetType to know how many / should be found
parent
7e4a5c23
Changes
1
Hide whitespace changes
Inline
Side-by-side
beat/editor/backend/assetmodel.py
View file @
061ce41e
...
...
@@ -112,6 +112,18 @@ class AssetType(Enum):
return
self
not
in
[
self
.
UNKNOWN
,
self
.
DATABASE
,
self
.
PROTOCOLTEMPLATE
]
def
split_count
(
self
):
"""Returns the number of "/" that should be part of its name"""
if
self
==
self
.
UNKNOWN
:
return
0
elif
self
==
self
.
EXPERIMENT
:
return
5
elif
self
not
in
[
self
.
DATABASE
,
self
.
PROTOCOLTEMPLATE
]:
return
2
else
:
return
1
def
validate
(
self
,
data
):
"""Runs the schema validation and returns whether an asset is valid
...
...
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