Discussion:
[Modeling-users] pymodel and association multiplicity
n***@tin.it
2004-08-31 22:38:15 UTC
Permalink
Hello,

I found what may be a bug in pymodel association multiplicity validation:

if I try:
multiplicity=[ [ 0, 1 ], [ 0, 2 ] ],
with vanilla Modeling 0.9-pre-17.1 it fails to accept it as a valid association.

patch follows, if I'm correct I'll post it in the patches section :)

--
Delio

diff -aur ModelingCore-0.9-pre-17.1/Modeling/PyModel.py Modeling/PyModel.py
--- ModelingCore-0.9-pre-17.1/Modeling/PyModel.py 2004-02-15 07:27:03.000000000 +1300
+++ Modeling/PyModel.py 2004-08-14 15:27:18.000000000 +1200
@@ -854,7 +854,7 @@
ds_mult=self.multiplicity[1]
if sd_mult[1]>1:
raise ValueError, 'invalid multiplicity src->dst: should be toOne'
- if not (ds_mult[1] in (None, '*', -1) or ds_mult[0]>1):
+ if not (ds_mult[1] in (None, '*', -1) or ds_mult[1]>1):
raise ValueError, 'invalid multiplicity dst->src: should be toMany'
return sd_mult, ds_mult
Sebastien Bigaret
2004-09-02 16:38:13 UTC
Permalink
Post by n***@tin.it
Hello,
multiplicity=[ [ 0, 1 ], [ 0, 2 ] ],
with vanilla Modeling 0.9-pre-17.1 it fails to accept it as a valid association.
patch follows, if I'm correct I'll post it in the patches section :)
Right, thanks for reporting. I'd prefer a report in the 'Bugs' section
w/ the patch attached, since this is not an enhancement but definitely a
bug fix!

-- Sébastien.
Post by n***@tin.it
--
Delio
diff -aur ModelingCore-0.9-pre-17.1/Modeling/PyModel.py Modeling/PyModel.py
--- ModelingCore-0.9-pre-17.1/Modeling/PyModel.py 2004-02-15 07:27:03.000000000 +1300
+++ Modeling/PyModel.py 2004-08-14 15:27:18.000000000 +1200
@@ -854,7 +854,7 @@
ds_mult=self.multiplicity[1]
raise ValueError, 'invalid multiplicity src->dst: should be toOne'
raise ValueError, 'invalid multiplicity dst->src: should be toMany'
return sd_mult, ds_mult
Sebastien Bigaret
2004-09-06 17:09:02 UTC
Permalink
The patch has been integrated into the CVS main trunk and will be in the
next release. Thanks for reporting!

-- Sébastien.


Ref.: Bug item #1023234
https://sourceforge.net/tracker/index.php?func=detail&aid=1023234&group_id=58935&atid=489335
Post by n***@tin.it
Hello,
multiplicity=[ [ 0, 1 ], [ 0, 2 ] ],
with vanilla Modeling 0.9-pre-17.1 it fails to accept it as a valid association.
patch follows, if I'm correct I'll post it in the patches section :)
--
Delio
diff -aur ModelingCore-0.9-pre-17.1/Modeling/PyModel.py Modeling/PyModel.py
--- ModelingCore-0.9-pre-17.1/Modeling/PyModel.py 2004-02-15 07:27:03.000000000 +1300
+++ Modeling/PyModel.py 2004-08-14 15:27:18.000000000 +1200
@@ -854,7 +854,7 @@
ds_mult=self.multiplicity[1]
raise ValueError, 'invalid multiplicity src->dst: should be toOne'
raise ValueError, 'invalid multiplicity dst->src: should be toMany'
return sd_mult, ds_mult
Loading...