[Modeling-cvs] ProjectModeling/Modeling PyModel.py,1.6,1.7
Status: Abandoned
Brought to you by:
sbigaret
From: <sbi...@us...> - 2003-11-15 13:02:45
|
Update of /cvsroot/modeling/ProjectModeling/Modeling In directory sc8-pr-cvs1:/tmp/cvs-serv23271/Modeling Modified Files: PyModel.py Log Message: * Fixed bug #842698: when a PyModel.Attribute property is set after instanciation, its value was never propagated to the final Attribute at build() time. * Fixed bug #841315: PyModel associations do not set the multiplicity bounds e.g. a toOne relationship was always [0,1] regardless of what the definition of the Association. Index: PyModel.py =================================================================== RCS file: /cvsroot/modeling/ProjectModeling/Modeling/PyModel.py,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** PyModel.py 30 Aug 2003 12:55:05 -0000 1.6 --- PyModel.py 15 Nov 2003 13:02:41 -0000 1.7 *************** *** 526,530 **** def build(self, model, entity): ! pass def clone(self): --- 526,535 ---- def build(self, model, entity): ! d={} ! selfdict=self.__dict__ ! [d.setdefault(k, selfdict[k]) for k in selfdict.keys() ! if k in Attribute.defaults.keys()] ! updateComponent(self, d, Attribute.defaults, self.name, ! ignore=('usedForLocking')) def clone(self): *************** *** 891,900 **** srcAtt=AForeignKey(self.keys[0]) srcE.properties.append(srcAtt) ! ## Now srcAtt and dstAtt are set # Relationships toOne_kw={} ; toMany_kw={} ! for k in ('delete','isClassProperty','joinSemantic','displayLabel','doc'): toOne_kw[k]=getattr(self, k)[0] toMany_kw[k]=getattr(self, k)[1] --- 896,907 ---- srcAtt=AForeignKey(self.keys[0]) srcE.properties.append(srcAtt) ! # automatic creation of the FK: set isRequired if applicable ! srcAtt.isRequired=self.multiplicity[0][0] ## Now srcAtt and dstAtt are set # Relationships toOne_kw={} ; toMany_kw={} ! for k in ('delete','isClassProperty','joinSemantic','displayLabel','doc', ! 'multiplicity'): toOne_kw[k]=getattr(self, k)[0] toMany_kw[k]=getattr(self, k)[1] |