Kai Hoppert wrote at 2004-8-2 14:04 +0200:
>i actually have a Problem with restrictedTraverse and hasattr.
>       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
>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...

Zope-Dev maillist  -  [EMAIL PROTECTED]
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope )

Reply via email to