Steve Alexander wrote:

>
>   return getattr(container.path.to.somewhere, name)
> 
> That's the simple version, and it won't give the traversed-to object the 
> correct context most of the time. To do that, I'd need to use an 
> external method, and use the __of__ method to give the returned object 
> an appropriate context.

However, if all you are doing is saying "does this object have the named 
attribute? if not, get it from another specialist", and you're using 
Specialist.getItem() to do the latter part, then the object you want 
comes ready-wrapped in the appropriate context, courtesy of the Rack 
that gives it to you!

-- 

Steve Alexander
Software Engineer
Cat-Box limited
http://www.cat-box.net



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

Reply via email to