[Zope-dev] Re: Zope 2.7.2, restrictedTraverse or hasattr

sureshvv shardasuresh at hotmail.com
Wed Aug 18 09:50:31 EDT 2004


Why dont you try:

'myobject' in Object3.objectIds('meta_type_name')

HTH,  Suresh

"Kai Hoppert" <kai.hoppert at tomcom.de> wrote in message
news:A54D5004067F2442B1B8177EB6FC41DD337E4F at justus.schrottplatz...
Hi all,

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. I know that he jump's to Object2. i testet
this with absolute_url, but this makes no sense i think. Either i never
noticed that this both funktions works in this way or it is a bug. If it is
no bug has anybody a solution for my problem?

Greetings

Kai Hoppert
___________________________________________________
tomcom Gesellschaft für Informationstechnologie mbH
Heuriedweg 14 | D-88131 Lindau
Fon +49 (0)8382 975844 | Fax +49 (0)8382 975855
kai.hoppert at tomcom.de | http://www.tomcom.de

This document should only be read by those persons to whom it is addressed
and is not intended to be relied upon by any person without subsequent
written confirmation of its contents.  tomcom disclaims all responsibility
and accepts no liability for the consequences of any person acting, or
refraining from acting on the contents of this document.  Any unauthorised
form of dissemination, copying, disclosure, modification, distribution
and/or publication of this message is strictly prohibited. For information
about tomcom please contact us on +49.8382.975844 or visit our web site at
www.tomcom.de


_______________________________________________
Zope-Dev maillist  -  Zope-Dev at zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists -
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )





More information about the Zope-Dev mailing list