2 Aug
2004
2 Aug
'04
8:41 p.m.
Kai Hoppert wrote at 2004-8-2 14:04 +0200:
i actually have a Problem with restrictedTraverse and hasattr.
Object1 Object2 Object3
I want to test if there exists a Object in Object3 wich has the same id and meta type how Object2 (id=myobject). so i ask
Object3.restrictedTraverse('myobject',None) or
hasattr(Object3,'myobject')
i every time get's true back.
You can write a Script(Python) "hasattr_unacquired" with parameters "obj, attr" and body return hasattr(obj.aq_inner.aq_explicit, attr) Note that a solution without the "aq_inner" will often work but is not reliable... -- Dieter