Commit 2593d1d8 authored by Samuel GAIST's avatar Samuel GAIST
Browse files

[backend][assetmodel] Also load basetypes for dataformats

parent 7d09f2c1
......@@ -24,6 +24,8 @@
###############################################################################
import os
import simplejson as json
import pkg_resources
from enum import Enum, unique
......@@ -156,7 +158,18 @@ class AssetModel(QStringListModel):
)
)
self.setStringList(sorted(latest_assets_list))
latest_assets_list = sorted(latest_assets_list)
if self.asset_type == AssetType.DATAFORMAT:
# Load basetypes
common_data = pkg_resources.resource_string(
"beat.core", "schema/common/1.json"
)
common_data = json.loads(common_data)
basetypes = common_data["definitions"]["basetype"]["enum"]
print(basetypes)
latest_assets_list = basetypes + latest_assets_list
self.setStringList(latest_assets_list)
def assetType(self):
"""Returns the asset type of this model
......
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