@@ -99,6 +99,7 @@ def __init__(self, name=None, type="n.s.", parent=None,
99
99
100
100
# This might lead to a validation warning, since properties are set
101
101
# at a later point in time.
102
+ self .sec_cardinality = sec_cardinality
102
103
self .prop_cardinality = prop_cardinality
103
104
104
105
for err in validation .Validation (self ).errors :
@@ -365,6 +366,34 @@ def get_repository(self):
365
366
def repository (self , url ):
366
367
base .Sectionable .repository .fset (self , url )
367
368
369
+ @property
370
+ def sec_cardinality (self ):
371
+ """
372
+ The Section cardinality of a Section. It defines how many Sections
373
+ are minimally required and how many Sections should be maximally
374
+ stored. Use the 'set_sections_cardinality' method to set.
375
+ """
376
+ return self ._sec_cardinality
377
+
378
+ @sec_cardinality .setter
379
+ def sec_cardinality (self , new_value ):
380
+ """
381
+ Sets the Sections cardinality of a Section.
382
+
383
+ The following cardinality cases are supported:
384
+ (n, n) - default, no restriction
385
+ (d, n) - minimally d entries, no maximum
386
+ (n, d) - maximally d entries, no minimum
387
+ (d, d) - minimally d entries, maximally d entries
388
+
389
+ Only positive integers are supported. 'None' is used to denote
390
+ no restrictions on a maximum or minimum.
391
+
392
+ :param new_value: Can be either 'None', a positive integer, which will set
393
+ the maximum or an integer 2-tuple of the format '(min, max)'.
394
+ """
395
+ self ._sec_cardinality = format_cardinality (new_value )
396
+
368
397
@property
369
398
def prop_cardinality (self ):
370
399
"""
0 commit comments