[Zope] Python question

Tom Nixon tom.nixon@aim23.com
Mon, 18 Mar 2002 16:03:13 -0000


I need a python script that will return the first folder in the
hierarchy above the current object. I have got this far, but it looks
like content_type isn't the property I need. Can anyone help me out?
Also, is there somewhere I can find a reference for this sort of thing
so I don't have to keep posting to the list?

p = context.aq_parent
while p.content_type != "Folder":
  p = p.aq_parent
return p