[Modeling-cvs] ProjectModeling/Modeling Entity.py,1.9,1.10
Status: Abandoned
Brought to you by:
sbigaret
From: <sbi...@us...> - 2003-03-17 10:27:16
|
Update of /cvsroot/modeling/ProjectModeling/Modeling In directory sc8-pr-cvs1:/tmp/cvs-serv26440 Modified Files: Entity.py Log Message: Fixed objectsPathForKeyPath(): under some circumstances it did not raise ValueError, as expected Index: Entity.py =================================================================== RCS file: /cvsroot/modeling/ProjectModeling/Modeling/Entity.py,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** Entity.py 10 Feb 2003 10:39:04 -0000 1.9 --- Entity.py 17 Mar 2003 10:27:09 -0000 1.10 *************** *** 404,407 **** --- 404,409 ---- either an Attribute or an Entity object. + Raises ValueError if 'keyPath' is not a valid path. + See also: destinationObjectForKeyPath() """ *************** *** 419,426 **** object=object.attributeNamed(key) objPath.append(object) if not isinstance(object, Attribute): objPath.append(rel.destinationEntity()) except AttributeError: ! raise ValueError, "Invalid keypath" return objPath --- 421,430 ---- object=object.attributeNamed(key) objPath.append(object) + if not object: + raise ValueError, "Invalid keypath '%s'"%keyPath if not isinstance(object, Attribute): objPath.append(rel.destinationEntity()) except AttributeError: ! raise ValueError, "Invalid keypath '%s'"%keyPath return objPath |