Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
T
telecom
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Roque
telecom
Commits
c2db525f
Commit
c2db525f
authored
Jun 27, 2017
by
Roque Porchetto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Workaround for "repeated data sets" bug.
parent
085b15fa
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
5 deletions
+20
-5
bt5/erp5_wendelin_telecom_ingestion/SkinTemplateItem/portal_skins/erp5_wendelin_telecom/getDataStreamList.py
...m/portal_skins/erp5_wendelin_telecom/getDataStreamList.py
+20
-5
No files found.
bt5/erp5_wendelin_telecom_ingestion/SkinTemplateItem/portal_skins/erp5_wendelin_telecom/getDataStreamList.py
View file @
c2db525f
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
)
...
...
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