Subject: Re: [Zope] restrictedTraverse Info
From: harshad behere <[email-masked]>
To: [email-masked]
Date: Tue, 20 Jul 2004 10:33:29 +0530

Jonathan Cyr wrote:

> Hello,
>
> I keep reading about restrictedTraverse, is there a resource with a 
> simple introduction and/or example of using this tool?
>
> Google doesn't yield any overviews, just specific questions.
>
> I have a problem were I have a path of a photo stored, but I'd like to 
> get the title as well... This tool seems to do that, but I don't know 
> the usage.
>
> -Jon Cyr
> _______________________________________________
> Zope maillist  -  [email-masked]
> http://mail.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce
> http://mail.zope.org/mailman/listinfo/zope-dev )
>
hi,
yes you can get title property. try following python scripts lines,

PATH = '/yourphotofolder/yourphotoid'
photoRef = context.restrictedTraverse( PATH )
phototitle = photoRef.getProperty('title')

harshad

-- 
Harshad Behere

ZeOmega (www.zeomega.com)
Open Minds' Open Solutions

20/21,Rajalakshmi Plaza,
South End Road,
Basavanagudi
Bangalore-560 004
India