Skip to content

Commit 8e50deb

Browse files
committed
[section] Add sec cardinality on init
1 parent 13fd740 commit 8e50deb

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

odml/section.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@ class BaseSection(base.Sectionable):
4343
:param oid: object id, UUID string as specified in RFC 4122. If no id is provided,
4444
an id will be generated and assigned. An id has to be unique
4545
within an odML Document.
46+
:param sec_cardinality: Section cardinality defines how many Sub-Sections are allowed for this
47+
Section. By default unlimited Sections can be set.
48+
A required number of Sections can be set by assigning a tuple of the
49+
format "(min, max)"
4650
:param prop_cardinality: Property cardinality defines how many Properties are allowed for this
4751
Section. By default unlimited Properties can be set.
4852
A required number of Properties can be set by assigning a tuple of the
@@ -60,7 +64,7 @@ class BaseSection(base.Sectionable):
6064
def __init__(self, name=None, type="n.s.", parent=None,
6165
definition=None, reference=None,
6266
repository=None, link=None, include=None, oid=None,
63-
prop_cardinality=None):
67+
sec_cardinality=None, prop_cardinality=None):
6468

6569
# Sets _sections Smartlist and _repository to None, so run first.
6670
super(BaseSection, self).__init__()
@@ -86,6 +90,7 @@ def __init__(self, name=None, type="n.s.", parent=None,
8690
self._repository = repository
8791
self._link = link
8892
self._include = include
93+
self._sec_cardinality = None
8994
self._prop_cardinality = None
9095

9196
# this may fire a change event, so have the section setup then

0 commit comments

Comments
 (0)