Commit c2db525f authored by Roque Porchetto's avatar Roque Porchetto

Workaround for "repeated data sets" bug.

parent 085b15fa
portal = context.getPortalObject()
portal_catalog = portal.portal_catalog
data_set = portal_catalog.getResultValue(
portal_type = "Data Set",
reference = data_set_reference)
#data_set = portal_catalog.getResultValue(
# portal_type = "Data Set",
# reference = data_set_reference)
#if data_set is None:
# return []
if data_set is None:
################################ workaround for "multiple-datasets" bug ################################
query_dict = {
"portal_type": "Data Set",
"reference" : data_set_reference}
data_set_list = portal_catalog(**query_dict)
if len(data_set_list) == 0:
return []
def belongsToDatasets(line):
for data_set in data_set_list:
if line.getAggregateDeviceConfiguration() == "data_set_module/" + str(data_set.getId()):
return True
return False
################################ workaround for "multiple-datasets" bug ################################
query_dict = {
"portal_type": "Data Ingestion Line",
"resource_portal_type": "Data Product",
......@@ -16,7 +30,8 @@ query_dict = {
data_stream_list = []
for line in portal_catalog(**query_dict):
if line.getAggregateDeviceConfiguration() == "data_set_module/" + str(data_set.getId()):
if belongsToDatasets(line):
#if line.getAggregateDeviceConfiguration() == "data_set_module/" + str(data_set.getId()):
for item in line.getAggregateSet():
if "data_stream_module/" in item:
data_stream = context.restrictedTraverse(item)
......
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