Re: pymodel and association multiplicity

Sebastien Bigaret <[email protected]> 06 Sep 2004 21:08:15 +0200
Newsgroups gmane.comp.python.modeling
Message-ID <[email protected]>
The patch has been integrated into the CVS main trunk and will be in the
next release.  Thanks for reporting!

-- S=E9bastien.


Ref.: Bug item #1023234
https://sourceforge.net/tracker/index.php?func=3Ddetail&aid=3D1023234&group=
_id=3D58935&atid=3D489335



[email protected] wrote:
> Hello,
>=20
> I found what may be a bug in pymodel association multiplicity validation:
>=20
> if I try:
> 	multiplicity=3D[ [ 0, 1 ], [ 0, 2 ] ],
> with vanilla Modeling 0.9-pre-17.1 it fails to accept it as a valid assoc=
iation.
>=20
> patch follows, if I'm correct I'll post it in the patches section :)
>=20
> --
> Delio
>=20
> 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=3Dself.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



-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop
FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=5047&alloc_id=10808&op=click