Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
ACS
Public
CIM
CIMpy
Commits
2d33591a
Commit
2d33591a
authored
Dec 11, 2019
by
Philipp Reuber
Browse files
change multiplicity check for multiplicity many to 'list'
parent
d6fddb09
Pipeline
#217727
passed with stages
in 22 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
cimpy/cimimport.py
View file @
2d33591a
...
...
@@ -233,7 +233,7 @@ def _set_attributes(res, xml_files, namespace_rdf, base, logger_errors_grouped):
if
default
is
None
:
# 1..1 or 0..1
# Rely on properties to set any bi-directional references.
setattr
(
obj
,
attr
,
val
)
elif
default
==
'
many
'
:
# many
elif
default
==
'
list
'
:
# many
setattr
(
obj
,
attr
,
[
val
])
elif
isinstance
(
default
,
list
):
# many
attribute
=
getattr
(
obj
,
attr
)
...
...
@@ -252,7 +252,7 @@ def _set_attributes(res, xml_files, namespace_rdf, base, logger_errors_grouped):
default1
=
getattr
(
val
,
obj
.
__class__
.
__name__
)
if
default1
is
None
:
setattr
(
val
,
obj
.
__class__
.
__name__
,
obj
)
elif
default1
==
'
many
'
:
# many
elif
default1
==
'
list
'
:
# many
setattr
(
val
,
obj
.
__class__
.
__name__
,
[
obj
])
elif
isinstance
(
default1
,
list
):
# many
attribute2
=
getattr
(
val
,
obj
.
__class__
.
__name__
)
...
...
Write
Preview
Supports
Markdown
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