[Zope] How to get PARENTS[-1] from within a Python Product

Ira Hochman go2ira@onebox.com
Tue, 29 Aug 2000 19:12:49 -0700


Thanks!

It turns out the expression is 

self.REQUEST.PARENTS[-1].absolute_url()


I'll see if I can put this into a useful tip.

-- 
Ira Hochman
go2ira@onebox.com - email
(617) 598-1014 x5511 - voicemail/fax



---- Dieter Maurer <dieter@handshake.de> wrote:
> Ira Hochman writes:
>  > How does one retrieve the equivalent of PARENTS[-1] from within
> a Python
>  > Product in Zope?
> ZPublisher places "REQUEST" at the top of the acquisition chain.
> "PARENTS" is an attribute of "REQUEST".
> 
> Therefore, you should be able to simple use "self.PARENTS[-1]".
> 
> If it does not, try "self.REQUEST.PARENTS[-1]".
> 
> 
> 
> Dieter
> 

__________________________________________________
FREE voicemail, email, and fax...all in one place.
Sign Up Now! http://www.onebox.com